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 concatenate all variables

VRNR
Kilo Contributor

Hi All,

I have created a Record producer with 4 variables(Multi line text).It will create a story(rm_story). Now i want to concatenate all 4 variables in description field.How to achive that?

Note: All variables are multi line text.

Regards,

Ram

5 REPLIES 5

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Ram,



You can do this via scripting in record producer script field.



current.TARGET FIELD COLUMN NAME HERE = producer.PASS VARIABLE NAME 1HERE   +' '+ producer.PASS VARIABLE NAME 2 HERE +' '+ producer.PASS VARIABLE NAME 3 HERE +' '+ producer.PASS VARIABLE NAME   4 HERE;



P.S: This will concatenate and display all variables in one line.


ccajohnson
Kilo Sage

Since this is a record producer, you can use the Script portion of the record producer to fill in different fields on the current target record. Let us say you have named your variables: var_one, var_two, var_three, var_four. Here is the way you can concatenate into the Description field:


var descText = producer.var_one + '\n';


  descText += producer.var_two + '\n';


  descText += producer.var_three + '\n';


  descText += producer.var_four;


current.description = descText;


Hi Christopher,


Thanks.It worked.



Now, one story is created as expected. I want the notification needs to send to person who opened. can you please help me to send notification for the story creation as mail.