Page 1 of 1

Help about the block: Map Values ?

Posted: 25 Mar 2020 01:41
by Hit
Does anyone know how to use the Action block: Map Values?
  • I had read the help instruction but didn't understand.
  • It can be useful.
  • I'd like to use it.
Here is the automagic help:
https://automagic4android.com/action_map_values_en.html

Thank you!

Re: Help about the block: Map Values ?

Posted: 25 Mar 2020 17:04
by Desmanto
The fastest way to learn it is to have something you want to achieve. We learn better while we need it. You can look at my index, section scripting - Map and list, to learn more : viewtopic.php?f=6&t=6993

We usually use map object just like a dictionary. We find a word inside dictionary and get the translation as the result. Usage case such as :
- translate word, "virus" >> a small infectious agent that replicates only inside the living cells of an organism
- Getting price from goods, "tissue" >> $5
- get product name from code, "123000456" >> apple
- getting date from the stored value, "birthday" >> 29 February 2020
- access other map, "attributes" >> return nested map object under this key

I never use map values action anymore nowadays. Because it is easier to use map object inside script. Look at here for simple map related function : viewtopic.php?f=5&t=7723