What is the best way to remove a JSON array from _raw JSON data and reserialize to _raw?
what is the best way to remove a JSON array from _raw JSON data and reserialize to _raw? I have a section of JSON data that I want to remove.
Answers
-
Eval the JSON part of _raw to a new field. Parse it. Serialize as key value (or whatever) to _raw. And / or replace the JSON in _raw with the result of the parsing,if you want to keep the surrounding data in _raw.
0 -
Assuming it is a string such as this..
0 -
Just remove it by first making it an object, and then remove the field as so:
0 -
That work for you <@UJYBKAR2Q>?
0 -
i will check it out here in a sec
0 -
If it is already an object `{}` vs. an ascii string `a`, then just the Remove Fields in an Eval Function is all you need.
0 -
No need to do a `JSON.parse(_raw)`, which makes it an object if you ever need to do that.
0 -
It is already an object
0 -
Perfect, then just an Eval Function with the Remove Fields. You can double click the array field name to copy it, then paste it into the Remove Fields section of an Eval Function.
0 -
ok so i did a remove fields and now that needs to be written back to _raw. I used serialize witj JSON object, now I have two _raw fields LOL
0 -
Just the Eval only is needed.
0 -
you are correct, just an eval to remove the section I did not need did the trick
0 -
Excellent!
0 -
Sometimes the easy button works!
0