Characters that cannot be used in "sysparm_query=" of "g_navigation.open" Part 2

bonsai
Mega Sage

The following questions give you an idea of ​​the strings that cannot be used.

 

https://www.servicenow.com/community/sysadmin-forum/characters-that-cannot-be-used-in-quot-sysparm-q...

 

 

A new problem has occurred.

I found that even when I use "encodeURIComponent", if the field value contains a "^" it is not reflected correctly.

I know that "^" is a symbol used to connect fields in a query.

Is it possible to use this symbol as text in a field value?

7 REPLIES 7

Ankur Bawiskar
Tera Patron

@bonsai 

yes if field value contains ^ then it might cause an issue.

I believe you cannot safely use ^ in a field value when passing it via sysparm_query because ServiceNow will always treat it as condition operators.

something like this might work if you want to send that symbol as field value

g_navigation.open('incident.do?sys_id=-1&description=' + encodeURIComponent('test^value'));

If my response helped please mark it correct and close the thread so that it benefits future readers.

Thanks.

@bonsai 

Glad to help.

If my response helped please mark it correct and close the thread so that it benefits future readers.

@bonsai 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.