I have a json data. I need key and value data from it. My json looks like this.
{
"content": {
"key1": "value1",
"key2": "value2",
}
}
Need to convert to the below format.
{
"Key": "key1",
"Value": "value1"
}
I tried below liquid. I get data as [key1,value1].
{%- for data in content -%}
"Key": {{data[0]}}
"Value": {{data[1]}}
{%- endfor -%}
In Liquid, you can extract key value pairs from a JSON object like the one you provided. But, you can access the keys and values in the JSON object in the following way: