Value should be Urgency + Short Description (after submission)

icelazer
Kilo Expert

Hi,

 

Newbie Developer here, hope you can help me on the script on how I will produce the combined value of Urgency + Short Description after submission of the creation of new request when it saved to Change request table. I'm using a record producer in this form. Thank you!

2 ACCEPTED SOLUTIONS

icelazer
Kilo Expert

Here's my screenshot of the script

icelazer_0-1694687368893.png

 

View solution in original post

Manisha Reddy K
Mega Guru

Hi @icelazer ,

      Assuming that you are storing the concatenated value in short description field of Change Request created and also the fields urgency and short description are variables in the Record Producer.

   Please use the below code

ManishaReddyK_0-1694688168363.png

 

Mark this as helpful if it is

View solution in original post

7 REPLIES 7

Vishal Birajdar
Giga Sage

Hi @icelazer 

 

Can you please let us know where you are storing this concatenated value (urgency + short description)?

Share some screenshot if possible.

 

 

 

Vishal Birajdar
ServiceNow Developer

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

Hello @Vishal Birajdar 

 

It should be stored in the Short Description field in the Change Request table once the request has been submitted in the record producer form.

 

icelazer_1-1694687402946.png

function onSubmit() {
// Get the selected Urgency value from the record producer form
var urgencyValue = gs.getValue('urgency'); // Replace 'urgency' with the actual field name

// Get the entered Short Description value from the form
var shortDescriptionValue = gs.getValue('short_description'); // Replace 'short_description' with the actual field name

// Combine the Urgency and Short Description values
var concatenatedValue = urgencyValue + ' - ' + shortDescriptionValue;

// Set the concatenated value in the Short Description field
gs.setValue('short_description', concatenatedValue);

// Continue with the submission
return true;
}

 

Hi @icelazer 

 

Can you try the script on record producer

 

current.short_description = current.getDisplayValue('urgency') + ' ' + current.short_description;

 

VishalBirajdar7_0-1694687848040.png

 

Vishal Birajdar
ServiceNow Developer

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

HI @Vishal Birajdar 

 

It's working!!! Thank you so much

 

icelazer_0-1694688415085.png