How to paas Multine Line text value through Flow Designer Rest API Actions in ServiceNow

Shantanu_99
Tera Contributor

Hi All,

 

Using Flow Designer Actions, I am making REST API call to send details using JSON format.

I have input type string variable in which I want to Requester For Details like Name, Location, Email and Manager.

 In the script section of input variables, I have written below code.

And I am getting error like {"statusCode":400,"error":"Bad Request","message":"Invalid request payload JSON format"}.

 

I want to pass details like below.

RequetserFor:- ABC

Location:- XYZ

Email:-abc@gmail.com

 

var reqinfo = "Requested For: "+ fd_data.trigger.current.u_request_item.variables.requestbytmp2_name.getDisplayValue()+ "\n"+
"Email: "+ fd_data.trigger.current.u_request_item.variables.requestbytmp2_email+ "\n"+
"Location / Property: "+ fd_data.trigger.current.u_request_item.variables.requestbytmp2_location.getDisplayValue()+ "\n"+
"Preferred Phone Number: "+ fd_data.trigger.current.u_request_item.variables.requestbytmp2_extension+ "\n"+
"Manager: "+ fd_data.trigger.current.u_request_item.variables.requestfor_manager.getDisplayValue();

return reqinfo;

 

How to send multiline text using JSON format in Flow Designer ServiceNow.

 

Thanks in Advance,

Shantanu

 

 

2 REPLIES 2

Shruti
Mega Sage
Mega Sage

Hi,

Please use JSON type of input variable

Shruti_0-1697463269456.png

 

Hi Shruti,

It is still not working using input variable type as JSON.

It is throwing same error {"statusCode":400,"error":"Bad Request","message":"Invalid request payload JSON format"}.