# Sanitizing user comment entries text field help

**URL:** <https://forum.inductiveautomation.com/t/sanitizing-user-comment-entries-text-field-help/57817>\
**Category:** Ignition\
**Created:** [March 30, 2022, 2:23pm UTC](https://forum.inductiveautomation.com/t/sanitizing-user-comment-entries-text-field-help/57817 "2022-03-30T14:23:18Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [March 30, 2022, 3:42pm UTC](https://forum.inductiveautomation.com/t/sanitizing-user-comment-entries-text-field-help/57817/21 "2022-03-30T15:42:52Z")

</div>

Can you post the whole script and error message? It’s not impossible, but it seems unlikely to me that an errant `]` character would cause an error if provided in the right place.

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [March 30, 2022, 3:43pm UTC](https://forum.inductiveautomation.com/t/sanitizing-user-comment-entries-text-field-help/57817/22 "2022-03-30T15:43:05Z")

</div>

Irosed asked why am I replacing 20 other characters.

I looked up methods of sterilizing the user comments  
this was among the recommendations

Zacht asked can I post the script and error.

I try to avoid posting some of the content so I don’t upset anyone here.  
I can see how the “]” might seem unlikely.  
I get many comments through this script daily.  
When I try to see like what is different from here to there, this “]” sticks out to me.  
I kind of think it might something that happens in 8.1.0 when the text field has more text than the column in the table was created to hold, but I am not sure.  
Though I also wonder why it says `File "",` in the error. Some values are showing as " "  
Maybe one of them being null is an issue.

no more questions for now, I am not fast enough at the moment

Thanks very much for the help, and again sorry if I missed any questions.  
I appreciate all the help. I still need to read more on that page that Peter posted and more about the try and except.

I am going to work on the try and except for now.

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [October 21, 2022, 8:09pm UTC](https://forum.inductiveautomation.com/t/sanitizing-user-comment-entries-text-field-help/57817/23 "2022-10-21T20:09:45Z")

</div>

I don't think I updated this.

I ended commenting out my sanitization because I was informed in this thread that prepupdate handles sanitizing.

I think the error was from comments being too long.

I used a parameter for the max length and comparing it as users put in data so that it would actually trim as they typed. I would link the thread if I could find it.

[Previous page](https://forum.inductiveautomation.com/t/sanitizing-user-comment-entries-text-field-help/57817.md?page=1)
