Skip to main content
Question

What is the best way to remove a JSON array from _raw JSON data and reserialize to _raw?

  • March 11, 2025
  • 14 replies
  • 75 views

Shawn Cannon
Forum|alt.badge.img

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.

14 replies

David Maislin

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.


David Maislin

Assuming it is a string such as this..


David Maislin

Just remove it by first making it an object, and then remove the field as so:


David Maislin

That work for you <@UJYBKAR2Q&gt;?


Shawn Cannon
Forum|alt.badge.img
  • Author
  • Known Participant
  • March 11, 2025

i will check it out here in a sec


David Maislin

If it is already an object `{}` vs. an ascii string `a`, then just the Remove Fields in an Eval Function is all you need.


David Maislin

No need to do a `JSON.parse(_raw)`, which makes it an object if you ever need to do that.


Shawn Cannon
Forum|alt.badge.img
  • Author
  • Known Participant
  • March 11, 2025

It is already an object


David Maislin

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.


Shawn Cannon
Forum|alt.badge.img
  • Author
  • Known Participant
  • March 11, 2025

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


David Maislin

Just the Eval only is needed.


Shawn Cannon
Forum|alt.badge.img
  • Author
  • Known Participant
  • March 11, 2025

you are correct, just an eval to remove the section I did not need did the trick


David Maislin

Sometimes the easy button works!


David Maislin

Excellent!