I want to use ParseJSON to get the property names from an array called questions. The property names in the returned JSON string that I'm performing the ParseJSON operation are not consistent.
Type casting the questions array to a table
Table(ParseJSON(lblCleanJSON.Text).questions)
Example JSON
I would like to get the three property names. In the example below they are: question, questionType and options. I can't refer to the property names by name because this string is likely to change.
{
"surveyTitle": "Incident Reporting",
"questions": [
{
"question": "What type of incident occurred?",
"questionType": "dropdown",
"options": ["Workplace injury", "Near-miss incident", "Property damage", "Security breach"]
},
{
"question": "When did the incident occur?",
"questionType": "dateTime",
"options": []
},
{
"question": "Where did the incident occur?",
"questionType": "text",
"options": []
},
{
"question": "What caused the incident?",
"questionType": "text",
"options": []
},
{
"question": "Did anyone witness the incident?",
"questionType": "radio",
"options": ["Yes", "No"]
}
]
}