alexSLO
(Alex)
March 25, 2021, 6:53pm
1
Hi guys,
Let’s assume a dictionary like that (from a json for example):
Is there any way to remove B,D and F pair based on the fact value is array without knowing the keys so the reuslt would be that:
I do not know what the keys are so I can’t remove by them. If dictionary would be like an array I would go through it by index and remove records with arrays in values.. But I do not know how to do that with dictionar.
Any suggestion?
Thabks, Aleks
TimAi2
(metricrat)
March 25, 2021, 8:12pm
2
Like this (to start with):
1 Like
Rogerio_Rios
(Professional Support)
March 25, 2021, 8:22pm
3
And Maybe you can also create Procedure with parameters and remove items according to the parameters …
Rogerio_Rios
(Professional Support)
March 25, 2021, 8:33pm
5
Maybe , You can try create a Procedure with parameters.
Maybe : Remove according to the parameter passed.
Superjay
(Jay Lee)
March 26, 2021, 1:00am
6
Use loop with dictionary and check if it’s list. And if it’s list, remove a current key.
alexSLO
(Alex)
March 27, 2021, 5:43pm
7
Thats exactly what I was looking for. I got to simmilar solution yesterday. Changed to list and then do the thing, except I decided to just change array into a simple string and that way when I converted back to dictionary it was still there just in a plain text format.
Thanks again, Alex
alexSLO
(Alex)
March 27, 2021, 5:44pm
8
That would be the easiest but did not found any option to go through the dictionary with a loop as there is no index like support (as it is at lists).
Alex
alexSLO
(Alex)
March 28, 2021, 10:02am
10
eh.. I was so in the way of index like solution that I did not consider going through keys would do the same job Thanks
Alex
TimAi2
(metricrat)
March 28, 2021, 10:43am
11
I did test with that block, but was unable to change the values in the dictionary…
system
(system)
Closed
April 27, 2021, 10:43am
12
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.