Send JSON Payload through flow designer

Shalaka
Tera Contributor

Hi Team,

Working on one Integration to send JSON payload to 3rd Party tool through flow designer. I have created an action comprising of Inputs and Output parameters with script to call REST message.

But, the input parameters mentioned in flow designer are not sending the request body in JSON format to 3rd Party tool.

Can someone suggest on this?

 

Thanks,

Shalaka Jaitapkar

4 REPLIES 4

panda1
Kilo Guru

Is the payload in the picture commented out?

Shalaka
Tera Contributor

Whenever I uncomment that code, I am getting an error but the input parameters should send the data.

Richard Hine
Tera Guru

What you have will not create a JSON Payload.

You will need somthing like this:-

var payloadObj = {
"name" :  inputs.name,
"userId" : inputs.userId,
"groupgroupGuid" : inputs.groupgroupGuid,
"grouproleGuid" : inputs.grouproleGuid,
};

var body = JSON.stringify(payloadObj);
r.setRequestBody(body);
var response = r.execute();

Hope this helps,

Richard

Mike I2
Giga Guru

Instead of a script step, have you considered a using a payload builder step instead?