How to Clear multiple dictionary key values

vyros4u

New member
How do I clear a dictionary variable with multiple keys values at once using the "Clear dictionary" action. like "Clear variable" action for normal variable.
Clear dictionary key uses radio button instead of check box, so you can't select multiple keys.
 

Endercraft

Moderator (& bug finder :D)
I'm afraid this is not possible directly. Only way would be to have a loop clear each variable 1 by 1 using a given list.
 

Dm114

Well-known member
How do I clear a dictionary variable with multiple keys values at once using the "Clear dictionary" action. like "Clear variable" action for normal variable.
Clear dictionary key uses radio button instead of check box, so you can't select multiple keys.
You can clear a whole level in case of multilevel dictionary/array but not several items in one action.
 

JA-Translator

Moderator
Well, I am not exactly sure, but I wonder ...
can't you use "Clear variable" action for Array?

If I am doing something wrong, then sorry about that. 😅

I tested as below.

Screenshot_20230524_172224.png

Screenshot_20230524_171834_MacroDroid.png

Screenshot_20230524_172043_MacroDroid.png
 

Dm114

Well-known member
Well, I am not exactly sure, but I wonder ...
can't you use "Clear variable" action for Array?

If I am doing something wrong, then sorry about that. 😅

I tested as below.

View attachment 5617

View attachment 5618

View attachment 5619
You're right: I wasn't clear enough. Clear variables action allows to clear a whole dictionary/array. I even made a mistake because it's not possible to clear programmatically a whole level. It's only possible manually (unless new MD versions allow that now: I didn't test it yet).
 
Top