- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2020 10:01 AM
Hello All.
Please could anyone help me with the question how to get the value of the Catalog Item variables displayed on the Catalog Task forms "Variables" section. In my example image the Catalog Task form "Variables" contain four variables. I need to retrieve value of the "Test number" variable and compare it with some values in my code and show the message to the user.
To keep the question simple - how to retrieve value of the catalog item variable displayed on the Catalog Task form's "Variables" section. Thank you in advance, any help very much appreciated.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2020 10:06 AM
Are you trying to get the values in a Client Script, or are you trying to get the in a workflow / Server-Side script?
If client side, the standard g_form.getValue('<fieldname>'); should return the value.
If in a workflow / server-side you would want to use current.variables.<fieldname> to return the current value.
Otherwise if you can describe your use-case, we can provide more detailed options.
If this was helpful or correct, please be kind and remember to click appropriately! Michael Jones - Proud member of the CloudPires team!
Michael D. Jones
Proud member of the GlideFast Consulting Team!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2020 10:04 AM
easy part is with a br
current.variables.<variable name>
and for client side look here:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2020 01:59 PM
Jorn, I was looking for the Client Script solution and its found now. Thank you so much for the response.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2020 10:05 AM
Hi there,
Where do you want to use the variable value? Client Side? Server Side? One specific variable? All variable?
If server side:
curent.variables.your_variable would do the trick.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2020 02:04 PM
Hello Mark. I coded the Client Script. I set Catalog Item variables into the variable set. That created difficulty with the variable value retrieval. I created single variable for catalog item and issue is solved. Thank you so much for the response.