JSON input for workflow config?

How do you handle that? In this current specific case it’s about an API that is a bit verbose and require a specific input in JSON. So I want to store the JSON “template” in the workflow and then simply replace the relevant data that I’m searching via the API. But how to store this JSON “constant” part in the workflow? Java and string nodes are annoying because of the need to escape the double quotes, so they are out. String configuration is also out as this part should not be exposed to a user of a component.

Then there is the JSON reader but I want to store this as components and last time I checked files can’t be stored as parts of components.

So what are the actual options?

Hi @kienerj ,
Does the JSON Schema Validator node help your cause? You can change the varying parts by using the flow variables.

Let me know if it does or not.

Thank you,
Sanket

Hi @kienerj , if you are simply trying to enter the json directly into a flow variable, I sometimes (mis)use the css-editor node for this purpose:

e.g. the above would create a flow variable “some json” with the contents of the multi-line json string you enter.

Alternatively, for creation of a single cell table containing a multi-line string, I have a component that allows you to do do that:

3 Likes

Okay, that’s clever :smiley:

1 Like

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