The data for a dropdown menu is retrieved from an API, but it is not in string format. How can I change the data type of this data?
1 Like
Hi @AnushkaGupta, I’ve faced this issue as well in the past. so I’m assuming that you are trying to fetch LOV using a DB query and its returning the result in a stringified JSON
eg.
{ "LOV":"[ { \"code\": 1, \"value\":\"TO DO\" }, { \"code\":2, \"value\":\"In Progress\" }, { \"code\":3, \"value\":\"Resolved\" }]" }
so lets say the value is stored in the path getVal(“tempObject.LOV”). So, what we have to do is that we have to parse the data type of the code by mapping it’s data path twice in the format. getVal(“datapath”,“datapath”).
So in the above example well have to do getVal(“tempObject.LOV”,“tempObject.LOV”).
1 Like