How to get the variable value

SNOW39
Tera Expert

Hi ,

I am trying to create a variable set that is visible only on sc_task, when the task is closed, it should pull the recurring price value mentioned when the catalog item is created (sc_cat_item). How to acieve this?

1 ACCEPTED SOLUTION

Hi,

ok so in the run script after the task is complete the script is added

please find the below code

Ensure you add current.setWorkflow(false);

current.variables.recurring_price = current.cat_item.recurring_price.toString();
current.setWorkflow(false);
current.update();

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

27 REPLIES 27

Joaquin Campos
Mega Sage

Hi,

 

As far as I know variables/variable sets are only used at RITM level and not at SC_TASK level.

Can't you handle the recurring price value at RITM level including the variable set in the corresponding catalog item?

 

Regards:

 

Joaquín

Hi, Thanks for response.

 

Yes. If it is not possible at sc_task level,We can do it at RITM level. Can you tell me how to get the recurring price value to one of the variable in variable set

Hi,

To include the variable set you just need to maintain the specific catalog item and add the variable set through its related list:

find_real_file.png

Anyway, recurring price something that is already available for each item and as long as price is not hidden, recurring price should be displayed as well:

find_real_file.png

 

If what you want to achieve is to have a RITM variable with the value of the recurring price then you can include the variable in your catalog item and assign recurring price value through a catalog client script.

Regards:

 

Joaquín

 

Can you help me with the script?