How to get Catalog Item Variable Value when "Save" Catalog task

zzsrvnow
Giga Contributor

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.

find_real_file.png

1 ACCEPTED SOLUTION

Michael Jones -
Giga Sage

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!

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

View solution in original post

6 REPLIES 6

Michael Jones -
Giga Sage

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!

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

Thank you, Michael.

I tried g_form.getValue('<fieldname>'); , but it didn't work in my Client Script. However, your answer forced 🙂  me to look into it more carefully. My Catalog Item variables were created in Variable set. I moved out from the variable set the filed I needed and set as a single variable and da-ta 🙂 my code returned the value of the variable. Thanks a million.