Need help.... Flow designer script error "attempting to use undefined input = 'current' from ...."

madanm7786
Mega Guru

Hi All,

I have created a subflow in Flow Designer to create an Incident from Alert.

I have written a script to map the assignment group, but i am getting below error

 "attempting to use undefined input = 'current' from ...."

Below is the script i have written, I have used to OOB Create Incident Flow Designer and modified to map Assignment group based on our logic.

 

var src = fd_data.trigger.current.source;
var gr = new GlideRecord('sys_user_group');
gr.addQuery('u_provider', src);
gr.query();
if(gr.next()
{
return gr.sys_id;
}

Any help please.

Thanks,

Madan

1 ACCEPTED SOLUTION

palanikumar
Mega Sage

Hi,

For subflow you cant access the value of trigger. You need to add input variable for subflow and pass value from main flow.

To access subflow input variable you can use below code:

var src = fd_data.subflow_inputs.source;

// Replace source in above code with the name of input variable

Thank you,
Palani

View solution in original post

4 REPLIES 4

Sheldon  Swift
ServiceNow Employee
ServiceNow Employee

Hi Madan,

It will be helpful if you can share a screenshot of the larger flow, including this specific action as well as the data pane.

palanikumar
Mega Sage

Hi,

For subflow you cant access the value of trigger. You need to add input variable for subflow and pass value from main flow.

To access subflow input variable you can use below code:

var src = fd_data.subflow_inputs.source;

// Replace source in above code with the name of input variable

Thank you,
Palani

Hi Palani,

Thanks for your help.

It worked with one modification. We need to do dot walking with input variable to get the field value.

var src = fd_data.subflow_inputs.alertgr.source;

Thanks Again...

 

Please close the thread if your issue is resolved

Thank you,
Palani