Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Display a value from a reference variable in a new variable on a catalog task

Danelle Lee
Tera Contributor

Hello,

 

I'm not sure if this is possible but thought it might be worth the question. I have created a catalog item for a SIM card activation and have created a reference variable so that when a laptop is selected the user has to locate their laptop number, of which the laptop number and SIM details from the CMDB computer table are displayed. However, I would like to create a new variable/field and have the SIM details display in this field as a read only on catalog task view. The SIM details will need to be dependent on the computer that is selected in the reference variable. Is this achievable?

 

I have tried creating a new single line text variable and an 'onsubmit' catalog client script to populate this field but it has not worked. (tried: g_form.setValue() ).

 

Thanks in Advance 🙂

Danelle

1 ACCEPTED SOLUTION

Brad Bowman
Mega Patron

Hi Danelle,

You can do this with an onChange or onSubmit Catalog Client Script using getReference or GlideAjax

https://docs.servicenow.com/bundle/tokyo-api-reference/page/app-store/dev_portal/API_reference/Glide... 

 

https://www.servicenow.com/community/developer-articles/glideajax-example-cheat-sheet-updated/ta-p/2...

 

In the Utah release and later, this can be done using the new variable auto-populate feature without a script.

https://www.servicenow.com/community/developer-articles/auto-populate-a-variable-based-on-a-referenc... 

 

Since you don't need to see these variables populated on the request form, you can also use a server script on your Flow or Workflow to do this after the request is submitted.

 

View solution in original post

1 REPLY 1

Brad Bowman
Mega Patron

Hi Danelle,

You can do this with an onChange or onSubmit Catalog Client Script using getReference or GlideAjax

https://docs.servicenow.com/bundle/tokyo-api-reference/page/app-store/dev_portal/API_reference/Glide... 

 

https://www.servicenow.com/community/developer-articles/glideajax-example-cheat-sheet-updated/ta-p/2...

 

In the Utah release and later, this can be done using the new variable auto-populate feature without a script.

https://www.servicenow.com/community/developer-articles/auto-populate-a-variable-based-on-a-referenc... 

 

Since you don't need to see these variables populated on the request form, you can also use a server script on your Flow or Workflow to do this after the request is submitted.