Syntax error - fd-data in send email

Deepthi25
Giga Expert

hi team, 

 

i am trying below script in flow designer "send email" but showing some error like below please suggest to debug this what is the issue.

Error: "fd_data" is not defined.,Detail: "fd_data" is not defined.

Code:

/*
**Access Flow/Action data using the fd_data object. Script must return a value.
**example: var shortDesc = fd_data.trigger.current.short_description;
**return shortDesc;
*/
var body;
body += 'Hello, <br/><br/>';
body += 'Requested For: ' + fd_data._1__get_catalog_variables.requested_by+"<br/>" ;
body += 'New User: ' + fd_data._1__get_catalog_variables.new_user_user_not_listed + "<br/>" ;
body += 'Requested By: '+ fd_data._1__get_catalog_variables.requested_by.getDisplayValue() + "<br/>" ;
body += 'Supervisor: '+ fd_data._1__get_catalog_variables.supervisor_name.getDisplayValue() + "<br/>" ;
body += 'Business Unit:'+ fd_data._1__get_catalog_variables.business_unit.getDisplayValue() + "<br/>" ;
body += 'Cost Center: ' + fd_data._1__get_catalog_variables.cost_center.getDisplayValue() + "<br/>" ;
body += 'Cost Center Name: ' + fd_data._1__get_catalog_variables.cost_center_name + "<br/>" ;
body += 'Username: ' + fd_data._1__get_catalog_variables.network_id + "<br/>" ;
body += 'Action: ' + fd_data._1__get_catalog_variables.action + "<br/>" ;
body += 'Location: ' + fd_data._1__get_catalog_variables.location + "<br/>" ;
body += 'ipad required: ' + fd_data._1__get_catalog_variables.ipad_required + "<br/>";
body += 'Planon Business Unit: ' + fd_data._1__get_catalog_variables.planon_business_unit.getDisplayValue() + "<br/>";
var gr1 = new GlideRecord("u_variable_choice_list");
gr1.addQuery("sys_id",fd_data._1__get_catalog_variables.add_role);
gr1.query();
if(gr1.next()){
addRoles = gr1.u_value;
}
body += "Add Role: "+addRoles+"</br>";
var remRoles = "";
var gr2 = new GlideRecord("u_variable_choice_list");
gr2.addQuery("sys_id",fd_data._1__get_catalog_variables.remove_role);
gr2.query();
if(gr2.next()){
remRoles = gr2.u_value;
}
body +="Remove Role: "+remRoles+"</br>";
body += 'Justification / Additional Comments: '+ fd_data._1__get_catalog_variables. justification_additional_comments
+ '<br /><br /> Thanks';
return body;
 
Error:
 find_real_file.png
@Ankur Bawiskar 
1 ACCEPTED SOLUTION

suvro
Mega Sage
Mega Sage

Where  fd_data is getting set, it is not setting properly

View solution in original post

6 REPLIES 6

suvro
Mega Sage
Mega Sage

Where  fd_data is getting set, it is not setting properly

hi suvro, any syntax error? or do i need to reenter every line fd_data?

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

your flow is triggering on Service Catalog or on some table?

Regards
Ankur

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

req item table onlyt, as suvro suggested i selected fd_data again for all lines now it working fine i guess