- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 02:55 AM
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!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 03:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 03:46 AM
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
Mark this as helpful if it is
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 03:07 AM - edited 09-14-2023 03:08 AM
Hi @icelazer
Can you please let us know where you are storing this concatenated value (urgency + short description)?
Share some screenshot if possible.
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 03:25 AM - edited 09-14-2023 03:30 AM
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.
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;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 03:38 AM
Hi @icelazer
Can you try the script on record producer
current.short_description = current.getDisplayValue('urgency') + ' ' + current.short_description;
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 03:47 AM