We are using jsonata expressions in node-red a lot together with git repos stored in github. Would it be possible to have the jsonata expression available in an external file within the project instead of just have the expression inline in the node itself?
Here is an example of what I mean from another integration tool (will not mention any names ).
I think it would make life easier when we want to track what happened to our expressions in git? Just a suggestion.
I'm not sure what you mean, JSONata is used in Node RED Core Nodes for single properties, are you using a Node that is for evaluating JSONata expressions only?
if so, you will need to request that from the Node author.
So basically what I'm doing is that I'm using a http in node, transforming the data to another format and then reply with the new data format (this was just an example). So what I would like to do is to store the jsonata expression (mapping) that I have created in a separate file, and not in the change node (flows.json) as it is now. Are you following?
That will be a significant piece of work to the core, as it will require another typedInput type.
the J: is currently in-line, so to use external expressions, will require dreaming up a new J: type.
such as eJ: for example.
I wouldn't count on this being developed anytime soon, as there are other priorities on the list.
With that said, I have moved this into Feature Requests, as the Core Team may have input into such a feature
Totally understandable, Feature requests sounds good. Thank you for quick reply!
And again, why I asking is because when doing changes to the mapping code it will be easier to track changes in any external git comparing tools instead of comparing the whole flows.json.
Its pretty much what @TotallyInformation suggested, but doing it on load, should remove the need to mess with the settings file, and will allow easy updates to expressions requiring only a Node RED restart - but then you could also add an inject node to reload the files removing the need for a restart all together
Mods: I moved this into FR's but clearly this seems a lot less intrusive to the core, feel free to move it away from FR's, if you feel its not worth pursuing