B4A Class Get value from complex structure (combination of map, list, array)


This is a module code to retrieve value from complex structure (combination of list, map, array and primitives types).

Give the path with a dot (.) separator to get the value or the default value if not accessible.

example : m=createmap("Name":"John" ,"Friends":array as map(createmap("Name":"Alan","Age":30),createmap("Name":"Mary","Age":28)))

get(m,"Friends.1.Age","Not Found") returns 28

get(m,"Friends.3.Age","Not Found") returns "Not Found"

This module runs on B4J and B4A



  • B4AGetValue.zip
    4.4 KB · Views: 212
  • B4JgetValue.zip
    3.4 KB · Views: 178
Last edited: