Remove Arrays and lists from dictionary (keeping only records with numbered or pure text values)

Hi guys,

Let’s assume a dictionary like that (from a json for example):

image

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:
image

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

Like this (to start with):

image

1 Like

And Maybe you can also create Procedure with parameters and remove items according to the parameters …

and then:

image

1 Like

Maybe , You can try create a Procedure with parameters.
Maybe : Remove according to the parameter passed.

Use loop with dictionary and check if it’s list. And if it’s list, remove a current key.

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

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

Not this block?

controls_for_each_dict

1 Like

eh… I was so in the way of index like solution that I did not consider going through keys would do the same job :slight_smile: Thanks

Alex

I did test with that block, but was unable to change the values in the dictionary…

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.