Greetings! I am very new to Node-Red and have been having a very difficult time finding a solution that makes sense to me, with my limited understanding of the process of things. Hopefully someone can help with this issue I'm having...
I have an app using FormIO to build a form. The data for which fields to build exists in a Function node - called form_definition - I have a Function node which is basically
msg.payload = { "array":["of", "objects"] }
return msg
In a Template node I have my HTML and in a <script> tag on the body of the page. I need to do the following in order:
- Load external data (which works)
- Using the
data, create a new Object var which contains some - but not all - of themsg.payloadkeys and values. Which ones get filtered out, changed, or remain is determined by the data loaded in step 1 - Pass the filtered
msg.payloadclone into FormIO to create a form - which fields are created will be determined by which fields were and weren't removed or edited from the originalform_definition
(for example: the form_definition has a required Password field. But, there may be a case where a password field isn't required, and so I don't want FormIO to concern itself with that info when it renders the form)
The only way I can find to even look at msg.payload is via "{{{payload}}}" but that just returns me [object Object] as a String, not an actual object. I'm unsure how to get a workable JSON String or Object returned to me in this step.
Should I try another type of node? JSON, a Switch? Should something get renamed? Does my body <script> tag need to get moved to an external Functional node?
Any help would be appreciated , thank you!
