The CreatorCon Call for Content is officially open! Get started here.

Getting '414 Request-URI Too Large' due to long URL

Kishore32
Tera Contributor

Hello,

I've created a custom button UI action and added some script to filter some records from a table. I'm preparing url with all the employee ids from the table and opening that url in different browser using 'g_navigation.openPopup' in UI action script. Here is the script include screenshot attached.

Challenge: Here url is going bigger because lot of employees. Its browser returning "414 Request-URI Too Large"

Can anyone please help me here to get resolve this or please share your valuable suggestions or any other solution for this scenario.

find_real_file.png

Thanks

 

6 REPLIES 6

palanikumar
Giga Sage
Giga Sage

Standard URL length is 2083 characters. If your URL is larger than the limit then you have two options:

1) Split the request. Call it multiple times matching the URL limit
2) Convert the API from GET method to POST method. Pass the data as request body.

Thank you,

Palani

Thank you,
Palani

Here I'm not using any API, I'm calling Script Include from a form UI Action script.

Could you please elaborate more if I'm missing anything.

Thanks

Srinivasulu Lag
ServiceNow Employee
ServiceNow Employee

Hi Kishore,

The solution for this issue is to create a dynamic group and associate all the users to that group from your results and modify your URL to pass user group id as a parameter to sys_user_grmember table to filter the user records.

Example for associating users to group.

var gr = new GlideRecord('sys_user_grmember');
gr.initialize();
gr.group = 'dynamic_group';
gr.user = eId;
gr.insert();

 

Please Mark ✅ Correct/helpful, if applicable.

Thanks,

Srinivasulu Laggala

Hi Srinivasulu,

Employees count may increase or decrease or changes. So every time I've to update the dynamic group by adding and removing the users? How to add that parameter to filter users records? can you please provide me some sample url.

Thanks