How to pass the variables (values) vial URL to the Service Portal?

Virendra K
Kilo Sage

Hi All,

I have created a custom table where I stored the variable values in "Item Details" field (snap 1) with a field label. When I open Catalog item in Portal (I am using URL to open a catalog item where I am passing sys_id of a catalog item (snap 2)) I want to put below variables value into their specific field.  I have a plan to push all variables (string) into JSON form and get populated.

find_real_file.png

I want to populate "Item Details" stored string /variable values in below item in their respective fields, like location, priority etc. 

How could I do this ?

What approach should I follow to store/pass the variable values through URL?

find_real_file.png

1 ACCEPTED SOLUTION

Allen Andreas
Administrator
Administrator

Hi,

Check out my post here: https://community.servicenow.com/community?id=community_question&sys_id=d1de646cdbc7d74423f4a345ca96... that was solved with the help of Jace. It's along the lines of what you're wanting to do.

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


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

View solution in original post

3 REPLIES 3

Allen Andreas
Administrator
Administrator

Hi,

Check out my post here: https://community.servicenow.com/community?id=community_question&sys_id=d1de646cdbc7d74423f4a345ca96... that was solved with the help of Jace. It's along the lines of what you're wanting to do.

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


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

Hi Allen,

Thanks for your reply. I guess this code may help me. I copied the code, but getting the error in For loop for "let". see below snap,

find_real_file.png

 

 

find_real_file.png

 

any idea ?

Brad Tilton
ServiceNow Employee
ServiceNow Employee

I think you would write an onload client script on the catalog item that uses GlideAjax to call a script include. The script include would use the sys_id of the catalog item to find the appropriate record on the custom table and then return that json object back to the client script for field population.