Populate variable field value with custom action value

Zane2277
Tera Contributor

I am fairly new to creating scripts in ServiceNow so if this question is not worded correctly I can add clarity. 

 

I have a catalog item for users to request access to a server and a dropdown to choose the duration of this access. The technician that fulfills the task will provide the date the access was provided in a Date variable and complete the task.

Zane2277_0-1687373571334.png

 

 

I have created a custom action to calculate the access expiration date based on the Date Access Provided field AND the duration chosen in the dropdown.

The action is calculating the expiration date correctly. 

The issue is updating the variable field on the catalog task using the value from the action. 

I have a wait for condition on the state of the RITM being false. If RITM state is false, I Get Catalog Variables and call the Calculate Expiration Date for Login Access action.

Zane2277_1-1687373726826.png

Zane2277_2-1687373781414.pngZane2277_3-1687373835591.pngZane2277_4-1687373876400.png

 

I had tried simply updating the catalog variable by using the value from the action but it seems I need a script to push the action value to the variable field. I am still learning scripting at this point so could use a suggestion on creating a variable value script. 

I do know I need to use fd_date.(action name).variable but am still not sure how to get that value to the variable field on the form. 

 

Any suggestions would be very helpful. Thank you.

 

1 REPLY 1

Muhammad Khan
Mega Sage
Mega Sage