You can do that if your top level flow item is an object (which is better for management anyhow IMO (since you can clean up by simply deleting the top level object)
I foresee lots of people getting into trouble with that though unless some additional validation were done. Because JSONata can output any structure not just a single string.
But the point is more that people with limited coding knowledge may use the suggested feature, with function nodes, you are already in the weeds. A matter of perception I know, but still - just sayin.
According to the survey, the size of the JavaScript programming language community is roughly 17.4 million software developers as of 2022, making it the most popular programming language in the world.
Where as JSONata doesnt even figure on any of the charts! (insignificant)
Its syntax is (forgive me) awful, and (IMO) really hard to grasp. Last but not lease, an order of magnitude slower to execute (sometimes 1000+% slower - I can post proof if need be).
I guess, in short, I am saying there is little logic in avoiding a function node when there is not a core or contrib node available to do a task.
PS: Simon, I have not forgotten your distain for Function nodes
Not at all. Just have an upper level object to hold all your stuff. There is no difference after that - just that you gain the ability to use [] and the ability to easily clean up. There are other advantages too (I wont go into)
The point was it is possible without JSONata or this feature request.
What is not possible is accessing top level flow/global values dynamically.