Shortening of encoded query
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2018 07:56 AM
We are creating URL based on an encoded query. In encoded query, there is 'IN' operator on which we are filtering long string of sys Ids. The number of sys Ids in some case exceeds more than 1000 which makes URL very very long. This long URL is not working on the browser because of the URL length limit. It throws HTTP code - 400. We have already tried Chrome, Firefox and Safari.
Is there any way to shorten this URL at Script Include level. Does ServiceNow platform provide any such utility?
- Labels:
-
Best Practices
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2018 08:37 AM
Hi,
Please see if this thread will assist you:
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-29-2018 10:21 AM
Hi,
I'm glad the Tiny URL worked for you.
Please mark reply as Helpfu/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
‎09-10-2024 05:41 AM
This thread is not opening
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2018 08:39 AM
Hello Amit,
What are the SYS_ID's. Can you make these SYS_IDs filtered by any attribute on the table? If Yes this is best way to construct your URL, so you could reduce the sysparm_query and you could use the attribute to fetch your data.
The limit on URL is by default fixed for all browsers and it cannot be changed. Also If you are making HTTP POST call instead of the URL as Get parameters, then you could override the URL limitation.
Thanks!