How to write script in flow designer.

Sai25
Giga Guru

Hi All,

How to write script in flow designer.

I want to write the below code in flow designer,

var groupValue=gr.assignment_group.u_auto_close_duration;
var half = (groupValue/2).toFixed(2);
var roundingValue=Math.round(half);
var gDate = new GlideDate();
gDate.addDays(roundingValue);
gr.work_notes="This case has been marked Resolved. It will be auto closed on"+" "+gDate+" "+" if you do not take action.";

Here i want to write the script. Please help me how to write.

find_real_file.png

Thank You,

Sai.

1 ACCEPTED SOLUTION

Harsh Vardhan
Giga Patron

Create custom action here so scripting will be done in custom action, and then you will use that action in your flow designer. 

 

Doc link for further details. 

 

https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/administer/flow-designer/concept...

 

 

View solution in original post

8 REPLIES 8

Hi Asif,

Updated the script. Still getting the same error.

find_real_file.png

Mohit Kaushik
Mega Sage
Mega Sage

Hi Sai,

Change the first line as per Asifnoor's code to 

var groupValue = fd_data.trigger.current.assignmment_group.u_auto_close_duration; //object should be fd instead of d

 

 

Thanks,

Mohit Kaushik

Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)

Hi Mohit,

I changed it, but it still not working throwing an error.

Thank You,

Sai.

Harsh Vardhan
Giga Patron

Create custom action here so scripting will be done in custom action, and then you will use that action in your flow designer. 

 

Doc link for further details. 

 

https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/administer/flow-designer/concept...