Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Redirection to portal url does not update the parent field

MS17
Tera Contributor

Hi All,

 

--While creating request from universal request using "Create Request" ui action, i have given the portal url in the ui action to submit the catalog items.

url = "sp?id=sc_category&sysparm_parent_table=" + current.sys_class_name + "&sysparm_parent_sys_id=" + current.sys_id;
now the url is redirected to the portal, but the parent field on the REQ is not updated with the Universal Request record. any suggestion? did I missed anything in the URL?
 
Thanks.
1 REPLY 1

KKM
Tera Guru

Hi MS17,

The issue here is that while your URL correctly redirects users to the portal to create a request, the parent field (sysparm_parent_sys_id) on the generated REQ record is not being set.

Possible Issues & Fixes:
Ensure that sysparm_parent_sys_id is being captured correctly

You are passing the sysparm_parent_sys_id in the URL, but the catalog submission process might not be using it properly.
Verify if the variable or field that stores sysparm_parent_sys_id in the sc_request table is being mapped correctly in your catalog submission.
Try using sysparm_parent instead of sysparm_parent_sys_id

Some versions of ServiceNow use sysparm_parent instead of sysparm_parent_sys_id.
Modify your URL to:

url = "sp?id=sc_category&sysparm_parent=" + current.sys_id + "&sysparm_parent_table=" + current.sys_class_name;
Ensure there is a Business Rule or Flow that handles Parent-Child relationships

If there's no logic to automatically associate the new REQ with the Universal Request record, you might need a Business Rule or Flow Designer flow on sc_request that checks for sysparm_parent_sys_id and updates the parent field.
Debug with URL Parameters

Before submission, check the generated URL to make sure sysparm_parent_sys_id is being appended properly.
Try opening the URL manually and checking if sysparm_parent_sys_id appears in the network requests (using browser dev tools).
Use a Client Script or Scripted UI Action to Set the Parent Field Manually
If none of the above work, you can use a Client Script on the Catalog form or a UI Action Script to explicitly set the parent field after submission.

This should solve your issue!

Kindly mark it as "Accepted Solution"/"helpful", as it resolves your query. Please press like button for the resolution provided.

With Regards,
Krishna Kumar M - Talk with AIT3ch
LinkedIn: https://www.linkedin.com/in/mkrishnak4/
YouTube: https://www.youtube.com/@KrishAIT3CH
Topmate: https://topmate.io/mkrishnak4 [ Connect for 1-1 Session]