Best answer

Fomatter - text split of email addresses in an array to separate field items

  • 5 June 2020
  • 1 reply
  • 1244 views

Userlevel 1

I'm trying to split text to multiple items that I can use in different fields in another step. It works fine for names but not email addresses for some reason.
 

I tried this and it worked for a simple array of Full Names - https://community.zapier.com/ask-the-community-3/line-item-usage-358 - but I get a different output structure for email addresses. 

From an Airtable record with a lookup array of Names [Jane Smith, John Smith] it returns:
output__Item 1: Jane Smith

output__Item 2: John Smith

which is exactly what what I want it to return.

Unfortunately, when I try the same formatting steps for email addresses in an array I get the following output where the item numbers are the same:

output:
0:

   Item 1: janesmith@email.com

1:

   Item 1: johnsmith@email.com

The problem is the are the same Item number so when I try to use them as inputs later on in the workflow as separte fields, the only selection I can use from this step is 'Output Item 1: "janesmith@email.comjohnsmith@email.com"' (an array, not separate items). 

Any thoughts?

icon

Best answer by Danvers 10 June 2020, 11:41

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Userlevel 7
Badge +12

Hi @CourtneyBaker!

 

The way that the email addresses are formatted in the output makes me think that they are a nested array (an array within an array), which is likely why the step isn’t working. 

 

One fix for this would be to address the source (see if there’s something that you can change in Airtable that will change the way the data is stored/sent). I’m not sure how possible that one is. 

 

The option for fixing this with Zapier would be to use some more Formatter steps. First you’ll need to use Formatter > Utilities > Line item to text. That will take the item array and convert it into a single text string separated by commas. If you then need to change this back into a single array (rather than a nested array) then you’ll need another Formatter step, this time using the ‘Text to Line item’ transform, which will convert the string into a regular line item array.