Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to parse JSON in liquid template #1415

Open
shubhamdhanetia opened this issue Mar 22, 2021 · 2 comments
Open

How to parse JSON in liquid template #1415

shubhamdhanetia opened this issue Mar 22, 2021 · 2 comments

Comments

@shubhamdhanetia
Copy link

In the JSON data, I am having serialize JSON data in a field.

How can I deserialize the JSON string and print it?

For Example :

{
"property1" : "ABC",
"property2": "{"firstname":"Shubham","lastname":"Dhanetia","dob":"2021-02-28T18:30:00Z"}"
}

How can we print the first name and last name from the field "property2" in the liquid template?

@samdoiron
Copy link
Contributor

There is no such functionality built in.

If you are using Liquid for your own software, you could implement it fairly easily as an extension. If you're working in Shopify, you may want to use metafields instead.

@trollkotze
Copy link

This is terrible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants