kind of but its much more accurate as you specify a path to the value you want to replace so if there were two objects that both had a child of the same name you could directly specify which one is being modified. much better for complex structures
EDIT: didnt see that you edited your message to basically say what i just said lol
Good idea. This would need to be somewhat type limited (assuming we want the general shape of the final object, in terms of type, to be the same) and/or just force the new value to a string, so maybe an additional field with that behavior (that field could also ask for the ideal final type).
Also not sure what it would do if that path doesn’t exist, presumably it would create a new entry. Maybe an output to indicate if this happened, and/or an input to define that behavior.
It should probably also return the previous value, possibly in addition to the new value (and of course the updated JSON string).
LMK what of this sounds good/bad or if you have any other ideas around possible edge cases or how to handle them. This seems pretty straightforward so I’ll implement this once the details are hammered out.
Also, would a “construct JSON” block also be something that people would be interested in? I’m not sure exactly what that would look like, maybe a custom UI like advanced conditionals where you create the JSON structure and can fill in variables. Could help avoid the dreaded escape and validation errors on network reqs.
I like the idea of it creating a new entry if the path does not exist, regarding types my thoughts were that it would just force it to a string to prevent any issues.
Having it output the previous value, new value and the updated JSON string sounds good.
A construct JSON block would be awesome and i think some kind of UI like the advanced conditionals would be perfect, do you want me to create a new post for this?
I’m working on a bot with lots of preferences and plan to store it in a DB with a column for Server ID and a column for Data. Should I spend some time to build a system to deal with modifications, or are you planning on adding this soon?