Query info is not present HTTP Request. Need to raw body

I’m creating a new Workflow in Pipedream which receives data from webhook and creates a lead in my CRM system.

I just need help with splitting JSON code to events (like on the 2nd screenshot) that can be used in the next step. How can i process data from the body to extract the needed info and use as variables?


The body looks like {“merchantAccount":“course_romanov_digital”,“orderReference”:“WFP-3788891-608aa009afd98”,“merchantSignature”:“sdfsgfgdfgdf97gs9dg7”,“amount”:1,“currency”:“UAH”,“authCode”:"",“email”:"mailto@gmail.com”,“phone”:“38091222334”,“createdDate”:1619697673,“processingDate”:1619697683,“cardPan”:“53****6748”,“cardType”:“MasterCard”,“issuerBankCountry”:“Ukraine”,“issuerBankName”:“MONObank”,“recToken”:"",“transactionStatus”:“Declined”,“reason”:“Declined To Card Issuer”,“reasonCode”:1101,“fee”:0,“paymentSystem”:“googlePay”,“acquirerBankName”:“WayForPay”,“cardProduct”:“debit”,“clientName”:“Romanov Kim”,“products”:[{“name”:"\u0413\u0430\u0439\u0434 \u043f\u043e \u0442\u0430\u0440\u0433\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u043a\u043b\u0430\u043c\u0435 \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u043e\u0432 \u043e\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430",“price”:1,“count”:1}]}

and the result I’m expecting is:
course_romanov_digital
WFP-3788891-608aa009afd98
sdfsgfgdfgdf97gs9dg7
etc

Hi @RomanovAgency , thanks for reaching out. If you inspect the event data in your trigger step, does the body arrive exactly like that, as a JSON string?

Pipedream should parse incoming JSON into its JavaScript object equivalent, so that you can reference properties by using variables like event.body.merchantAccount (for example).

If for some reason we’re not parsing the JSON as a JavaScript object, would you mind clicking the Share button in the top-right of the workflow and share it with dylan@pipedream.com so I can take a look? In this case, you can also add a new Node.js code step to your workflow, just below the trigger, and add some code like this to parse the body yourself:

return JSON.parse(event.body)

Then sending a new or test event through your workflow, and you’ll see the parsed data returned below that step. You should be able to copy the references to any of the fields within that parsed object and use them in future steps.

Let me know if that helps.

Thanks. Already resolved with the similar code
var log = steps.trigger.event.bodyRaw;
return (JSON.parse(log));
But 1000 thanks for an answer!