zapier-platform icon indicating copy to clipboard operation
zapier-platform copied to clipboard

{{parent}}[]{{key}} not works for Output Field

Open jimmyshiau opened this issue 5 years ago • 3 comments

My response data is

{
  "name": "text",
  "tags": ["aa", "bb"]
}

I tried to set Output Fields to tags[]0, tags[]1, tags[]2 But not working

https://github.com/zapier/zapier-platform/tree/master/packages/cli#nested--children-line-item-fields-1

children (line item) fields use {{parent}}[]{{key}}.

jimmyshiau avatar May 18 '20 10:05 jimmyshiau

Field tags is not empty

aa,bb

But tag[]0 is empty

jimmyshiau avatar May 18 '20 10:05 jimmyshiau

It seems only support line item object, not support get n children, it need another step to split text Screen Shot 2020-05-25 at 9 42 09 AM

jimmyshiau avatar May 25 '20 01:05 jimmyshiau

Hey @jimmyshiau! Caleb here with an answer on this - line items are defined as an array of objects, while lists are defined as an array of primitives:

{
  lineItems: [
    { tag: "foo" },
    { tag: "bar" }
  ],
  tagList: ["foo", "bar"]
}

In this case, lineItems[]tag is the proper key for line items outputFields, and tagList is the proper key for a list outputField. 🙂

Feel free to close if that answers your question! If not, I'm happy to help clarify further!

codebycaleb avatar Sep 08 '20 00:09 codebycaleb