Hello,
I am using a ConfiForms TextArea field and creating a JSON payload that is sent to Jira.
Whenever a user enters a hard return (newline) in the TextArea field, the JSON generation fails with an error similar to:
For example, if the TextArea contains:
the JSON payload breaks unless I manually replace the line breaks.
Error looks like (note replaced middle of code with ....
"description": "Request: A B\n\n...\nIssue Link: XXXXX-1" Invalid format. Unterminated string at 698 [character 0 line 36]
My question is:
What is the supported ConfiForms syntax to escape or encode CR/LF characters from a TextArea field before inserting the value into a JSON payload?
Is there a better way to do this?
I am looking for the recommended approach to handle multiline TextArea content safely when building JSON in ConfiForms.
Thank you.
Use escapeJSON function
Something like this
"description": "[entry.myTextAreaField.escapeJSON]",
Alex
Good morning @Alex Medved _ConfiForms_
Thank you so much for your help! I came across a similar recommendation while researching the issue and had seen your earlier response, but I could not get it to work on my first, second, and third tries.
I appreciate you helping me get past this roadblock.
Thank you so much!
Wende
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.