Dear all,
I am struggling in using ParseJSON PowerApp function to access JSON key with hyphen charachter "-" (e.g. "en-EN").
Let us consider this example of JSON string that is retreived via HTTP call.
Let us also consider that such JSON string is stored into jsonString variable.
{
"description":{
"en-EN":"...",
...
}
}
When I try to access to the JSON key "en-EN" powerapp throws to me an error in the second line.
Set(jsonObject;ParseJSON(jsonString));;
Text(jsonObject.description.en-EN);;
error:
"
The argument type is invalid. one of the following values is expected: Number, Text, Boolean.
The name is invalid. "EN" not recognized.
"
Do you know how to access to any key having an hyphene symbol as "en-EN"?
Thanks.
Just as an FYI, based on this and other feedback asking this same question, I've updated the docs for parsejson, working with json, and untyped object to mention using single quotes to access fields with otherwise non-valid identifier names.
You can put the property name in single quotes for any special identifiers (for example JSON allows a property named 0 or special characters like you have).
Text(jsonObject.description.'en-EN');
Stay up to date on forum activity by subscribing.
WarrenBelz
770
Most Valuable Professional
stampcoin
494
MS.Ragavendar
399