Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to get the value of Variable in Variable Set

Takumi Ando
Tera Contributor

I have a question about the Record Producer script.
I have a variable set for the user information input section that can be used in other catalogs.
I would like to get the value in the variable set and set it to the field in the record when I create the record, How do I write a record producer script?

1 ACCEPTED SOLUTION

Vishal Birajdar
Giga Sage

Hello @Takumi Ando 

 

You can use like below :

 

var variable_1 = producer.variable_name; //to get variable value

current.setValue('field_name', variable_1);  //set value on record

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

View solution in original post

6 REPLIES 6

AI Generated ! 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

@Sohail Khilji Thanks for your note!

I just wanted to clarify that I did enhance my words, but I can assure you, no AI magic involved—just a sprinkle of inspiration! And yes, I noticed those words might sound a bit 'Shashi Tharoor-ish,'😂 but hey, a little linguistic flair never hurt anyone!😉