Can anybody help figure out why this is not simply returning the ID at the end of this sequence?
I’m trying to just extract the letters/numbers after the comma but it seems to grab all of the occurrences even with Match All set to No. There is a set of 4 values all comma separated, but I’m only trying to grab the last one.
Setup:
Current Output:
Best answer by Troy TessaloneBest answer by Troy Tessalone
@JutstinD
FYI: When using a Code step, all input parameters are treated as strings. (e.g. array gets converted to a string, number gets converted to a string, etc.)
Here’s what’s likely happening with the Formatter > Text > Split as you had it configured…
The input value is an array, so the Formatter > Text > Split step is merely returning the array line items, since the input value is not a text string, thus the step is not actually finding any commas to split by due to the nature of the data (array vs text).
Example when I test with a string input separated by commas
Try this instead with the Formatter: (see screenshot note)
Formatter > Utilities > Line Items to Text (delimit with comma)
Hi @Troy Tessalone thanks for the suggestion. I’m getting the same issue, it returns all 4 matches instead of just the last even though it’s set to last.
It is inside of a loop so maybe this is a bug with the loop function causing it?
I managed to find a workaround by using this python code snippet and Code By Zapier. Not sure why these other methods are returning every match even with the qualifiers.
Here’s some screenshots of the split attempt. Maybe I’m missing something but this is what it’s giving me and when I try to use the output variable it contains all 4 pieces.
FYI: When using a Code step, all input parameters are treated as strings. (e.g. array gets converted to a string, number gets converted to a string, etc.)
Here’s what’s likely happening with the Formatter > Text > Split as you had it configured…
The input value is an array, so the Formatter > Text > Split step is merely returning the array line items, since the input value is not a text string, thus the step is not actually finding any commas to split by due to the nature of the data (array vs text).
Example when I test with a string input separated by commas
Try this instead with the Formatter: (see screenshot note)
Formatter > Utilities > Line Items to Text (delimit with comma)
There it is, @Troy Tessalone Thank you for all of the help on this! I didn’t understand why it was returning me a string of all of my custom fields to begin with, so it makes a lot more sense that it was actually an array.