The CreatorCon Call for Content is officially open! Get started here.

Populate Short Description on case level based on Topic details field of type "Select Box"

Community Alums
Not applicable

When i am creating a case via record producer, there is one field "Topic Details " of data type "Select Box" , I want to populate Short description on case level with the value entered in Topic Details.

How can i populate Short description(which is of type String) with the value entered in Topic Details(Which is of type "Select Box").

1 ACCEPTED SOLUTION

Hi,

so you don't want the short description to populate with OOB logic.

then use before insert business rule on Case table and similar script

current.short_description = current.variables.variableName.getDisplayValue(); // give the variable name here

OR you can use after insert BR if the before insert doesn't work

current.short_description = current.variables.variableName.getDisplayValue(); // give the variable name here

current.setWorkflow(false);

current.update();

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

5 REPLIES 5

shloke04
Kilo Patron

Hi,

Please use the below script in your Record Prodcuer:

current.short_description = producer.VariableName.getDisplayValue(); // Replace Variable Name with Topic Details backend Name of variable

 Refer to screenshot below where you need to make this change to:

find_real_file.png

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can use 2 ways

1) Map to field on Record producer and map the Variable Topic Details to Short Description field

OR

2) use record producer script

current.short_description = producer.variableName.getDisplayValue(); // give the variable name here

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Community Alums
Not applicable

Hi Ankur ,

Thanks for your reply!

The code you have given works perfect , when case created via record producer is in draft state , but we are using hr_ServiceUtil() script include , which is making case in ready state and short description is getting populated with "hr_service case for subject_person" how can i stop this thing.

Hi,

so you don't want the short description to populate with OOB logic.

then use before insert business rule on Case table and similar script

current.short_description = current.variables.variableName.getDisplayValue(); // give the variable name here

OR you can use after insert BR if the before insert doesn't work

current.short_description = current.variables.variableName.getDisplayValue(); // give the variable name here

current.setWorkflow(false);

current.update();

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader