HOW TO: Use handlebars to pass the value of a variable in an array as part of the Relative URI
In this scenario, you need to pass the value of a variable in an array. You have 3 items in your array and would like to send the product as part of the Relative URI
{
"Data":
[
{
"product": "bikes"
},
{
"product": "snowboards"
},
{
"product": "skis"
}
]
}
If you’re using our beta UI:
- Choose Yes (Advanced) on the One to many field.
- Define the Path to many as “Data”. This will inform your handlebar expressions to read from properties in the objects of the array that you’ve defined, in this case, “Data”.
- In the Relative URI field, you can reference the fields in the objects from the “Data” array directly as if they were on the root path, such as
/api/abccompany/v1/products/{{product}}
You may also need to adjust your HTTP request template and use the JSON pathing above.
If you’re using our current UI:
- Choose Yes (Advanced) from the Does each individual record being processed translate to multiple records in the import application? Option.
- In the Relative URI field, type the code above.
1
Comments
Please sign in to leave a comment.