Shortening of encoded query

Amit160
ServiceNow Employee
ServiceNow Employee

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?

 

11 REPLIES 11

Allen Andreas
Administrator
Administrator

Hi,

Please see if this thread will assist you:

https://community.servicenow.com/community?id=community_question&sys_id=0f1a4b69db5cdbc01dcaf3231f96...

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

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!

This thread is not opening

Alikutty A
Tera Sage

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!