String manipulation for requests body

Hi,

I’m trying to dynamically build a request body using the String Manipulation node that should then be used as the request body in downstream POST request node. The correct request body looks like this:

{ “niche”: “SomeNicheValueHere”, “title”: “SomeTitleValueHere” }

In my input data I have ATTR1 and ATTR2 that should replace SomeNicheValueHere and SomeTitleValueHere dynamically. Trying to build this via the join() function in String Manipulation just generates a bunch of errors, I think primarily since the actual body contains “” which messes with the join() function.

Could anyone please help me with ideas on how to construct the String Manipulation function?
Thank you in advance!

Hi @cason,

I wouldn’t concern with the String Manipulation Node, but instead use the Table to JSON Node. It converts your input table row-wise into JSON objects. You can then loop over these JSON objects and perform POST requests for each of them.

A lot cleaner and a way less headaches :grin:

I added you an example workflow to my NodePit Space:

Best regards,
Daniel

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.