I have a Looper Provider providing JSON data. One of the elements is an array with arbitrary keys. I would like to access the key names as headings.
My row is providing the following JSON:
[
{"title": "New Job",
"location" : "Fairhope, AL",
"data" : [
{"Department" : "QA"},
{"Pay" : "$100/hr"}
]
},
{"title": "Newer Job",
"location" : "Point Clear, AL",
"data" : [
{"Department" : "Jr QA"},
{"Hours" : "20"}
]
}
]
I have a Column that is a Looper Consumer,
and a Headline whose text is made up of {{dc:looper:field key="title”}} and {{dc:looper:field key="location”}}.
Following the Headline I have an Accordion block that is a Looper Provider, with the input as Dynamic Content set to {{dc:looper:field key="data”}}.
The Accordion has a single item set as a Looper Consumer.
The Content is set to {{dc:looper:item}}.
But I cannot figure out a way to set the header that will return the keys like “Department” or “Hours”, etc.
I will have an arbitrary mix of parameters under the “data” array. I really cannot restructure at this point the data with a further level of nesting where data is an array of arrays ([‘key’ => ‘hours’, ‘value’ => ’20 hours per week’]).
How can I access the key names? I can restructure the Looper & Consumers and change types.