- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2022 12:16 PM
How do I populate a variable in a variable set, with a value from the user record?
I had a question of how to do this on an Inc/Req form but that solution doesn't work for Variable Set.
See image below on one of our Catalog Items. The 'Requested For' and 'Requested By' and 'Epic confirmed provider' are all Variables on our Variable set.
How can i populate the 'Epic confirmed provider' value on the Variable set, depending on the True/False value on the same named field on the User record?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2022 01:04 PM
Hi,
You can use a catalog lookup definition for this. Requires absolutely no scripting.
You simply set it up and use the requested for field as the source, the sys_user table as the table, the lookup value by sys_id, then select the setter variable to your epic confirmed provider by using the same field from that looked up user profile.
Additionally, if you needed to set other variables as well using sys_user record information, you have access to that now or in the future as well, all set up, and easy to use!
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2022 12:33 PM
Hi Russell,
Please refer to this solution you may need to modify but you will find your answer in there.
Based on checkbox field value, I need to set variables value true or false?
Mark Correct or Helpful if it helps.
***Mark Correct or Helpful if it helps.***
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2022 12:34 PM
To clarify, you want this value to be set on the catalogue form once the 'Requested For' is populated?
The approach I usually take with something like this is to use an onChange client script on the 'requested for' field, which triggers a GlideAjax call. Return an object of user record values queried from the sys_user table, and then set the values on the form appropriately.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2022 01:04 PM
Hi,
You can use a catalog lookup definition for this. Requires absolutely no scripting.
You simply set it up and use the requested for field as the source, the sys_user table as the table, the lookup value by sys_id, then select the setter variable to your epic confirmed provider by using the same field from that looked up user profile.
Additionally, if you needed to set other variables as well using sys_user record information, you have access to that now or in the future as well, all set up, and easy to use!
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2022 08:58 AM
This works for me, thank you!