Skip to main content

I am trying to separate a line of text in one field on google sheets into multiple fields. What is the best suggestion?

 

Hi @hughesdc 

Good question.

Since it appears you can have a variable # of comma delimited values in any order, you’d likely need to use a Code step to parse and prep the data to be mapped to the desired columns.


Hi @hughesdc!

Troy’s right that the most efficient way to do it is likely to be with a code step, but it is also possible to do this by using Looping and Paths. 

Looping allows you to run actions in Zapier based on the number of items you have. It can work using a comma-separated list, so it would run through all of the actions in the loop based on the number of words there are separated by commas. 

In the loop, you would need a path with a branch for each possible answer. After the path, add a step that will update the row in Google Sheets with the information in the relevant column. 

 

If you’re looking to make a note in each column based on whether or not the symptoms are listed, there might be a way to do it that doesn’t involve code or advanced features like Paths and Looping. Here’s an outline of how to do that:

  1. For each symptom column, add a Formatter step. Select Number for the event and Spreadsheet-style formula for the transform. 
  2. Use an IF formula that states ‘if the symptom field contains x symptom, then output “yes”, otherwise leave blank’ 
  3. After the Formatter steps, add a Google Sheets Update Row step and map the output of each formatter step to the relevant column.  

 

You can learn more about this Formatter function in the guide: Use spreadsheet-style formula functions in Zaps

 

​I hope that helps, please let us know if you have any questions!