I know [] are used with arrays - could be something around that?
@PaulKortman it sounds like @AndrewJDavison_Luhhu is likely correct about this and the brackets are for those that contain multiple values (arrays). Were you able to confirm this on your end?
I think it's right, but I don't get it, I split a block of text into fields (based on the [:newline:]) and then I have 7 Items/fields. But before that step I split the block(s) of text into line items, based on a keyword. So here's a visual:
0:
- Field 1
- Field 2
- Field 3
- Field 4
- Field 5
- Field 6
- Field 7
1:
- Field 1
- Field 2
- Field 3
- Field 4
- Field 5
- Field 6
- Field 7
And in this case the square brackets [] works, {{44202530__output[]Item 4}} and I get line items (comma separated) for Field 4. Where as {{44202530__output__Item 4}} gives me nothing.
If however I run a different data set through the zap that only has one paragraph (not two like the example above) In my head I should get the following:
0:
- Field 1
- Field 2
- Field 3
- Field 4
- Field 5
- Field 6
- Field 7
But the square brackets don't work in this case, and I have to use {{44202530__output__Item 4}} to get the value of Field 4. Perhaps the data actually is not line items because there is only 1 result or only 1 line, so perhaps the data is actually:
- Field 1
- Field 2
- Field 3
- Field 4
- Field 5
- Field 6
- Field 7
So right now I'm using both in my Zap, for a field where I need the value(s) from Field 4 I use:
{{44202530__output[]Item 4}} {{44202530__output__Item 4}}
Which seems problematic, sometimes there is an extra space before, sometimes after, in this specific Zap it doesn't matter, but it seems crazy to me that I have to specify both to account for when it has one one "line" versus when it has multiple lines.
Am I crazy? Has someone else seen this?
Hi @PaulKortman, you're definitely not crazy! I've come across this behaviour, too.
When looking at the value mappings (that you're calling shortcodes here), both double underscores __ and square brackets >] denote nested values. Names after __ are nested single values and names after >] are nested arrays (what typically we call line items).
As a general rule, what we'd want to see is that any time a nested value could be an array, it should be presented as such with >], even if it only has one item. The problem is that I've seen some app integrations that when only receiving a single item for an array don't wrap that single item in an array, so we end up with __ instead.
If we're seeing an array value that doesn't look like an array in Zapier when there is only 1 item, we should be creating a bug report for that issue. If the app giving this data is public, please let us know by submitting a support ticket so that we can do that for you.
In the meantime, the solution would be to map both possibilities into the field you're sending the value to in the Zap. If the mapped value is usually {{123456__value_namem]Item}}, then you'd want to also map {{123456__value_name__Item}} into the same field so that whichever one comes through will be sent to that Step in the Zap.
@TimS Thank you so much for the response. I already had done the work around you suggested but I thought perhaps this was poor form on my part or that I was doing something wrong.
In this case it is a public app (webflow) and I will submit a support request to create a bug report. But it's good to know I'm not crazy, that with one sample data the brackets work and with another sample data the brackets didn't work. It was a bit of a stroke of luck to me that I even caught this before it went into production. But now that I know to look for this and that it's not impossible to have these situations it'll make it easier to spot in the future.