Personalized checkout and custom promotions with Shopify Scripts
How to return json root with liquid? Assuming the root is unnamed how can it be rendered?
{
"name": "John",
"title": "Developer"
"info": {1, 2, 3}
}
Hi @Johnwe 👋 define what you mean by "root" and in context of which system.
This is the shopify-scripts forum for a now depreated feature that works in the checkout, not for javascript or liquid related issues.
Alot of shopify interfaces do not allow raw access to underlying contexts.
Contact [email protected] for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
Hi Paul
Please let me know if there's a better place to post liquid questions.
I want the top level of the hierarchy. I'm assuming that I could get the
full json and then target the top level object by index number? Or is there
a way just to get the top level items?
In this example I want just everything from "id" to "updated_at". I don't
want any of the sub levels inside "answers".
{
"id": "6002730376226774524",
"form_id": "241027993450154",
"ip": "74.113.132.26",
"created_at": "2024-08-23 21:43:57",
"status": "ACTIVE",
"new": "1",
"flag": "0",
"notes": "",
"updated_at": null,
"answers": {
"First Answer": {
"name": "administrativeContact",
"order": "22",
"sublabels": "{ \"field_1\":\"First Name\",\"field_3\":\"Last
Name\",\"field_4\":\"Phone\",\"field_5\":\"Title\"}",
"text": "Administrative Contact",
"type": "control_mixed",
"answer": {
"field_1": "Jack",
"field_3": "Waters",
"field_5": "Director",
"field_4": "111-111-1111"
},
"prettyFormat": "
First Name:
Jack
Last Name:
Waters
Title:
Director
Phone:
111-111-1111
"
}
}
}
Thx!
What "hierarchy", where do "answers" come from, etc Is this chatgpt generated?
Other people are not mind readers shopify is big system provide context.
There is no defined "control_mixed" type in shopify
"administrativeContact" is normally something found in DNS records which shopify does not have api access for, or B2B systems
Do you mean the shop object in liquid for a theme as "root"?
https://shopify.dev/docs/api/liquid/objects/shop
Explain the goal and specifics, what is the context of the code samples:
https://meta.stackexchange.com/questions/18584/how-to-ask-a-smart-question
Good Luck.
Contact [email protected] for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
The data source isn't Shopify. I'm using Liquid in a non-Shopify context (Azure), which supports Liquid. The source json comes from jotform.
When i said "root" i was referring to the json data itself, not any external system. I meant the top level of the json structure i shared.
I assume Liquid syntax doesn't care where the data comes from.
Thx.
Shopify != general liquid support.
Shopify is the the ecommerce platform.
Liquid is just a templating language they made for their themes that they made open source that other platforms use too.
https://github.com/Shopify/liquid
Unless this in the context of an actual shopify theme or app you've come to the place that built a bolt designer for how bolts are made for yet other bolt sellers instead of the car dealership.
For third party systems, or third party libraries, implementing a programming language as a custom DSL see that third parties docs, forums or support.
Contact [email protected] for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024