how to set a variable that is not on the form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2017 09:59 AM
I have a look up select box, once the user selects the value I want to pull the sys_id of the selected value to another variable which is not on the form. How can I do that? I dont think I can use Catalog client script since the field is not on the form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2017 10:03 AM
Hi Sam,
Is it catalog item which you are referring.
Yes you cannot use catalog client script for this unless and until it is present on the form i.e. visible or invisible
As an approach I would suggest to have this field on form and hide using catalog onLoad script so that you can set it using g_form.setValue();
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2017 10:03 AM
Hello Sam,
You can set the value of the field on the form is hidden via UI policy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2023 05:14 PM
I am hiding state field in UI policy (based or logged in user) and trying to set that field in UI action but its not working ! Do i have to unhide and set then hide?