Skip to main content
Best answer

Lookup Row in Google Sheets and Looping

  • 11 October 2023
  • 3 replies
  • 567 views

Ugh! I’m stumped!

I’m looking up a GSheet Row (example below)

...and it’s returning the following when looking up “Sweep” in Column A.

 

My Problem: Google doesn’t return a comma separated list, it separates each value. This means the “Loop by Zapier” step can’t grab all of them at once (see below). I’ve tried using the Formatter > Line Item to Text, but because the number of columns returned is variable (for instance, “Mow” will only return 2 columns) I can’t get it to work correctly.  

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

3 replies

Userlevel 7
Badge +14

Hi @arrw24 

Good question.

GSheets returns data for each column as a separate value.

One option would be to put each Task comma separated into 1 column (e.g. Column B and rename as Tasks)

Then you can use the Zap action: Looping > Create Loop from Text

 

Or you can pivot the data to have 1 row per Type/Task. (so 2 Columns only - Type in Column A & Task in Column B)

Use the GSheets Find Rows to find all the rows matching the Type.

Then you can use the Zap action: Looping > Create Loop from Line Items

 

Another option is use Airtable instead of GSheets.

Airtable is a relational database app.

You can link records across Tables to create relationships.

That would return data as an array of line items.

 

Userlevel 1
Badge

@Troy Tessalone you’ve saved my @$$ 3 times in the past week. RESPECT!

I ended up converting the spread sheet to two columns and then using a Formatting step to convert the Line Items to Text. 😀

Userlevel 7
Badge +11

Yay! That is fantastic news @arrw24! 🎉 Awesome work here as always, @Troy Tessalone! 👏👏👏 

So pleased you were able to get this sorted. If you do run into any further issues or have any questions at all please do reach out again - the Community is always eager to help! 🤗