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.

Update Template field value in Json format from the custom string field

Rahul k
Tera Guru

We have below form where u_checklist_item is the custom filed. If user put the checklist item name (checklist_item_name_1, checklist_item_name_2, checklist_item_name_3, etc) then, those value should auto update in the "template" field in below format.

 

{"owner":"sys_id from the user field","name":"","items":[{"name":"checklist_item_name_1","order":0},{"name":"checklist_item_name_2","order":1},{"name":"checklist_item_name_3","order":2},{"name":"checklist_item_name_4","order":3},{"name":"checklist_item_name_5","order":4}]}

before saving form it look as below:

Rahulk_0-1718172452551.png

after saving form it should look like below:

Rahulk_1-1718172701648.png

 

I am going to write before business rule, can someone help me with script.

0 REPLIES 0