SorenB
(Søren Schytz Birk)
December 9, 2025, 11:30am
1
Hi
I have a jObject with nested jArray where I need to remove (or keep) specific indexes within.
See example JSON below.
{
"key1": "abc",
"key2": "def"
"forms": [
{
"key1": "abc",
"key2": "def
},
{
"key1": "abc",
"key2": "def
},
{
"key1": "abc",
"key2": "def
},
]
"key3": "xyz"
}
I need to keep only one of the entries inside the “forms” jArray - eg. remove index 0 and 2, so the middle one is kept.
The overall structure should remain, but simply remove specific entries from a jArray.
See image for reference.
I know that you can remove specific keys/values from a jArray by using the Invoke Code activity, but I am unsure of how it should be configured, to achieve the desired format.
Example:
@ppr
Regards
Soren
ppr
(Peter Preuss)
December 9, 2025, 12:13pm
2
as far as we have understood you want to remove entries form the JArray, which are JObjects.
So there are two strategies:
removing items by index (indexes ordered DESC) and the removal one by one
OR: replace the JArray by a modified JArray, which kept only the needed items
UPD-1: Docu Linke Added
1 Like
SorenB
(Søren Schytz Birk)
December 9, 2025, 12:32pm
3
ppr:
(indexes ordered DESC)
Hahah perfect
Of course I was missing the Reverse to make sure the indexes wouldn’t change when the iteration removes entries.
Thanks @ppr
I ended up with this code:
Regards
Soren
system
(system)
Closed
December 12, 2025, 12:33pm
4
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.