- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2020 05:46 PM
Hello,
How do I add Encoded multiple AND query in URL?
Following is Encoded Query.
"companyLIKEindia^model_category!=6d593627db9d4b44386879531f9619c0^model_category!=cd49b227db9d4b44386879531f9619e9"
var url = https://xxxx.service-now.com/api/now/table/alm_hardware?sysparm_display_value=true&sysparm_exclude_reference_link=true&sysparm_limit=20000 &sysparm_fields=sys_id%2Cassigned_to";
Please advise.
Thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2020 06:28 PM
Hello,
That error appears to be related to some other part of your code, not what I'm answering in this post.
You can comment out the url components and see if the error still occurs, if so, then it's related to something else.
I'm merely covering a url that is assigned to a variable as string and concatenating the sysparm_query piece on to it.
I know when I copied your script before...you had a space in your url...and it appears you didn't copy and paste what I posted...so maybe that's an issue.
var url = https://xxxx.service-now.com/api/now/table/alm_hardware?sysparm_display_value=true&sysparm_exclude_reference_link=true&sysparm_limit=20000 &sysparm_fields=sys_id%2Cassigned_to";
Please review the script I posted...
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2020 06:18 AM
Hi Allen,
I was able to figure that out finally. We need to format as below for encoded query.
Replace ^ with %5E, then it is working fine.
var encQuery = "companyLIKEindia%5Emodel_category!=6d593627db9d4b44386879531f9619c0%5Emodel_category!=cd49b227db9d4b44386879531f9619e9";
Thanks.