{
"requests": [
{
"createItem": {
"item": {
"title": "Email",
"questionItem": {
"question": {
"required": false,
"textQuestion": {}
}
}
},
"location": {
"index": 0
}
}
},
{
"createItem": {
"item": {
"title": "Product Title",
"questionItem": {
"question": {
"required": true,
"textQuestion": {}
}
}
},
"location": {
"index": 1
}
}
},
{
"createItem": {
"item": {
"title": "Product SKU Code",
"questionItem": {
"question": {
"required": true,
"textQuestion": {}
}
}
},
"location": {
"index": 2
}
}
},
{
"createItem": {
"item": {
"title": "OFB Marketplace",
"questionItem": {
"question": {
"choiceQuestion": {
"type": "CHECKBOX",
"options": [
{ "value": "Food" },
{ "value": "Beverages" },
{ "value": "Merchandise" },
{ "value": "Services" }
]
}
}
}
},
"location": {
"index": 3
}
}
},
{
"createItem": {
"item": {
"title": "CFM Marketplace",
"questionItem": {
"question": {
"choiceQuestion": {
"type": "CHECKBOX",
"options": [
{ "value": "Services" },
{ "value": "Merchandise" },
{ "value": "Outwear" },
{ "value": "Beverages" },
{ "value": "Meat Dairy and Vegetable Products" },
{ "value": "Prepared Food" }
]
}
}
}
},
"location": {
"index": 4
}
}
},
{
"createItem": {
"item": {
"title": "List Price",
"questionItem": {
"question": {
"textQuestion": {}
}
}
},
"location": {
"index": 5
}
}
},
{
"createItem": {
"item": {
"title": "Price",
"questionItem": {
"question": {
"textQuestion": {}
}
}
},
"location": {
"index": 6
}
}
},
{
"createItem": {
"item": {
"title": "Inventory",
"questionItem": {
"question": {
"textQuestion": {}
}
}
},
"location": {
"index": 7
}
}
},
{
"createItem": {
"item": {
"title": "This product has multiple options, like different sizes or colors",
"questionItem": {
"question": {
"choiceQuestion": {
"type": "RADIO",
"options": [
{ "value": "Yes" },
{ "value": "No" }
]
}
}
}
},
"location": {
"index": 8
}
}
},
{
"createItem": {
"item": {
"title": "Section 2: Type of Variation",
"pageBreakItem": {}
},
"location": {
"index": 9
}
}
},
{
"createItem": {
"item": {
"title": "Type of Variation",
"questionItem": {
"question": {
"required": true,
"choiceQuestion": {
"type": "RADIO",
"options": [
{ "value": "List Variation" },
{ "value": "List Variations (Non SKU)" },
{ "value": "Text Variation" }
]
}
}
}
},
"location": {
"index": 10
}
}
},
{
"createItem": {
"item": {
"title": "Section 3: Options",
"pageBreakItem": {}
},
"location": {
"index": 11
}
}
},
{
"createItem": {
"item": {
"title": "Option",
"questionItem": {
"question": {
"choiceQuestion": {
"type": "RADIO",
"options": [
{ "value": "Pack Size" },
{ "value": "Size" },
{ "value": "Color" },
{ "value": "Material" },
{ "value": "Weight" },
{ "value": "Select this if you want to enter a different option" }
]
}
}
}
},
"location": {
"index": 12
}
}
},
{
"createItem": {
"item": {
"title": "Section 4: Custom Option Name",
"pageBreakItem": {}
},
"location": {
"index": 13
}
}
},
{
"createItem": {
"item": {
"title": "Custom Option Name",
"questionItem": {
"question": {
"textQuestion": {}
}
}
},
"location": {
"index": 14
}
}
},
{
"createItem": {
"item": {
"title": "Section 5: Option Values",
"pageBreakItem": {}
},
"location": {
"index": 15
}
}
},
{
"createItem": {
"item": {
"title": "Option Values (separate the values using comma e.g. option1,option2,option3)",
"questionItem": {
"question": {
"textQuestion": {}
}
}
},
"location": {
"index": 16
}
}
}
]
}
need to implement a Go to section based on answer rule in a JSON payload
ok so here’s what I want to happen, we need a Go to section based on answer rule, there should be a proper mapping of questions based on answers, they are define below. Pls provide the correct json code
- In the question “This product has multiple options, like different sizes or colors” if the user answer is Yes, the user should be set to answer the section “Type of Variation”, if their answer is No, then submit the form
- In the “Type of Variation” question, if the answer is “List Variation” they should answer the section under “Option”
- In “Option” if the answer is anything aside from “Select this if you want to enter a different option” they should be redirected to the section of “Option Values (separate the values using comma e.g. option1,option2,option3)”
- In “Option” if the user answer is “Select this if you want to enter a different option” the user should be redirected to the section “Custom Option Name”
can you help me how to implement these?
Joseph Torres is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Using JSON Payload for Go to Section
I have added this specific portion to your current Json. Please ensure that the ItemID
for Section 2: Type of Variation
is updated accordingly.
{
"value": "Yes",
"goToSectionId": "CHANGE IT WITH YOUR ITEMID FOR SECTION 2: TYPE OF VARIATION"
},
{
"value": "No",
"goToAction": "SUBMIT_FORM"
}
Completed JSON Payload:
{
"requests": [
{
"createItem": {
"item": {
"title": "Email",
"questionItem": {
"question": {
"required": false,
"textQuestion": {}
}
}
},
"location": {
"index": 0
}
}
},
{
"createItem": {
"item": {
"title": "Product Title",
"questionItem": {
"question": {
"required": true,
"textQuestion": {}
}
}
},
"location": {
"index": 1
}
}
},
{
"createItem": {
"item": {
"title": "Product SKU Code",
"questionItem": {
"question": {
"required": true,
"textQuestion": {}
}
}
},
"location": {
"index": 2
}
}
},
{
"createItem": {
"item": {
"title": "OFB Marketplace",
"questionItem": {
"question": {
"choiceQuestion": {
"type": "CHECKBOX",
"options": [
{
"value": "Food"
},
{
"value": "Beverages"
},
{
"value": "Merchandise"
},
{
"value": "Services"
}
]
}
}
}
},
"location": {
"index": 3
}
}
},
{
"createItem": {
"item": {
"title": "CFM Marketplace",
"questionItem": {
"question": {
"choiceQuestion": {
"type": "CHECKBOX",
"options": [
{
"value": "Services"
},
{
"value": "Merchandise"
},
{
"value": "Outwear"
},
{
"value": "Beverages"
},
{
"value": "Meat Dairy and Vegetable Products"
},
{
"value": "Prepared Food"
}
]
}
}
}
},
"location": {
"index": 4
}
}
},
{
"createItem": {
"item": {
"title": "List Price",
"questionItem": {
"question": {
"textQuestion": {}
}
}
},
"location": {
"index": 5
}
}
},
{
"createItem": {
"item": {
"title": "Price",
"questionItem": {
"question": {
"textQuestion": {}
}
}
},
"location": {
"index": 6
}
}
},
{
"createItem": {
"item": {
"title": "Inventory",
"questionItem": {
"question": {
"textQuestion": {}
}
}
},
"location": {
"index": 7
}
}
},
{
"createItem": {
"item": {
"title": "This product has multiple options, like different sizes or colors",
"questionItem": {
"question": {
"choiceQuestion": {
"type": "RADIO",
"options": [
{
"value": "Yes",
"goToSectionId": "CHANGE IT WITH YOUR ITEMID FOR SECTION 2: TYPE OF VARIATION"
},
{
"value": "No",
"goToAction": "SUBMIT_FORM"
}
]
}
}
}
},
"location": {
"index": 8
}
}
},
{
"createItem": {
"item": {
"title": "Section 2: Type of Variation",
"pageBreakItem": {}
},
"location": {
"index": 9
}
}
},
{
"createItem": {
"item": {
"title": "Type of Variation",
"questionItem": {
"question": {
"required": true,
"choiceQuestion": {
"type": "RADIO",
"options": [
{
"value": "List Variation"
},
{
"value": "List Variations (Non SKU)"
},
{
"value": "Text Variation"
}
]
}
}
}
},
"location": {
"index": 10
}
}
},
{
"createItem": {
"item": {
"title": "Section 3: Options",
"pageBreakItem": {}
},
"location": {
"index": 11
}
}
},
{
"createItem": {
"item": {
"title": "Option",
"questionItem": {
"question": {
"choiceQuestion": {
"type": "RADIO",
"options": [
{
"value": "Pack Size"
},
{
"value": "Size"
},
{
"value": "Color"
},
{
"value": "Material"
},
{
"value": "Weight"
},
{
"value": "Select this if you want to enter a different option"
}
]
}
}
}
},
"location": {
"index": 12
}
}
},
{
"createItem": {
"item": {
"title": "Section 4: Custom Option Name",
"pageBreakItem": {}
},
"location": {
"index": 13
}
}
},
{
"createItem": {
"item": {
"title": "Custom Option Name",
"questionItem": {
"question": {
"textQuestion": {}
}
}
},
"location": {
"index": 14
}
}
},
{
"createItem": {
"item": {
"title": "Section 5: Option Values",
"pageBreakItem": {}
},
"location": {
"index": 15
}
}
},
{
"createItem": {
"item": {
"title": "Option Values (separate the values using comma e.g. option1,option2,option3)",
"questionItem": {
"question": {
"textQuestion": {}
}
}
},
"location": {
"index": 16
}
}
}
]
}
This code meets the requirements you listed in your question.
If the question is,Does this product have multiple options, like different sizes or colors?
and the response is Yes
, it should direct to the type of variation
with the three options (List Variation, List Variation (Non-SKU), and Text Variation). By selecting any of these, you will be redirected to Option
, and then to Custom Option
.
However, if No
is selected, it will direct you to submit the form
.
Sample Output:
Reference:
Option