How to pass an entire JSON from a node to Execute command [object Object]

Hello,
I would like to pass the JSON response of a node, as an input parameter of a function inside the execute command block.

As in the following screenshots:

Clicking on Raw value I understand that it creates an object.
As I show from the screen, in output the preview shows me: [object Object]

  • What kind of object is it?

  • Can I input it as a parameter to a function in an execute command block?
    Such as: python3 main.py -a json_object

  • How should I read it? Do I have to decrypt it?

  • Or the only way to pass all the json as an input parameter to a function, is to pass it a .json file saved on disk? And so using first the “move binary data” → “write binary file”
    Like this:

A thousand thanks

The challenge that you are running into is that the node wants to pass an object while you require a string. If you use values rather than raw values, this should generate a concatenated string of values that can be passed to your EXECUTE node. It may still need to be modified but at least it will send you in the right direction.

1 Like

Thanks for the reply.
Unfortunately I cannot pass the JSON as a parameter because it contains spaces.

I found how to solve it:

  • first I transform raw value into string with JSON.stringify ()
  • then encode the result to eliminate annoying spaces and characters with encodeURI (). I don’t know why the base64 encode was giving problems

Like this: {{encodeURI(JSON.stringify($node[“Typeform Trigger”].json[“form_response”][“answers”]))}}

I was inspired by this post

1 Like

Hi there, necro-thread but this helped me figure out a problem.

I kept getting [Object: at the beginning of a JSON string if I just used the {{ $json }} expression. This made the string invalid JSON, and I was trying to insert it as a row on a SQL table with ISJSON=1 as a constraint.

I tried all sorts of REPLACE stuff and such, but no luck.

I found this post and changed the syntax to {{ JSON.stringify($json) }} and that resolved my issue. So not quite the same problem, but same problem domain.

If anyone else has this issue and comes across this post, this is how to fix it.

Step by step. This solution is useful for big JSON data, which can’t be passed into the command line