Skip to main content
Question

How to use individual row data from “Lookup Spreadsheet Rows (output as Line Items)" in Google Sheets?


In Google Sheets, I used the feature of “Lookup Spreadsheet Rows (output as Line Items)”, and this returns multiple rows as expected.  So my lookup returned 3 rows and the useable data (output) has the data like this: Bill, Sally, Joe,  In other words, all first names (1 from each row) are outputted by together.  So if I want to use each name individual I would just use a TEXT Formatter and split the data by a comma.  When I do that I see the names listed like this:

 

However, when I go to use this output data, all of the names appear together again; I cannot use output 1 or output 2

 

Help please!!

 

GML

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

20 replies

Userlevel 7
Badge +14

Hi @blueguy 

We need more context about how you are trying to use the returned GSheet row data in following Zap action steps. (screenshots)

Userlevel 3
Badge +3

Hello Troy

 

Thanks for the helping hand.

 

When you search by multiple rows that output really is the column of each row found.  So is column B in the spreadsheet that was searched is the First Name, then all the first names put in a single line item as the output. 

 

To answer your question specifically, I want to be able to use each individual value found in that row.  

I hope that is clear.

 

gml

Userlevel 7
Badge +14

@blueguy 

Try using the Looping app to iterate on each row: https://zapier.com/apps/looping/help

Userlevel 3
Badge +3

Thank you for the speedy response; I always learn something new from you

 

What goes in this field?

 

 

Userlevel 3
Badge +3

I am not sure I get the point of being able to look up multiple rows if you cannot use the data

 

gml

Userlevel 7
Badge +14

@blueguy 

Check the field description for guidance.

Set whatever value you want.

 

Userlevel 3
Badge +3

Action step:

the TEST

you only have 1 useable value on the next step

 

Userlevel 7
Badge +14

@blueguy 

Help article for using the Looping app: https://zapier.com/apps/looping/help

 

Userlevel 7
Badge +14

@blueguy 

It’s still unclear how you are trying to use the data from the GSheet in the Formatter and Code steps and any following Zap steps.

Outlined a specific example will provide more context along with screenshots showing how your Zap steps are configured in EDIT mode.

 

Userlevel 3
Badge +3

Okay...what you are seeing are just other steps I am trying to play but okay here are the specific steps/ I will do my best:

 

LOOKUP MULTIPLE ROWS in Google Sheets by 2 variables

 

These are the results or TEST

 

MY LOOP steps/ app & event

ACTION STEP

The results of the loop

My action step only has 1 CHOICE

 

Where are the other names?  How do I find the other names?

 

There were 6 loops made but I can only use 1 name for future steps….

 

Thanks

Userlevel 7
Badge +14

@blueguy 

If you want to process each ROW found from GSheets, then the Looping step will iterate thru each found ROW.

Per the Looping help docs, when testing a Zap step within (aka after) the Looping step it will only show you info from the first loop.

Turn the Zap ON and test live to have all the Loop iterations processed.

 

Help article for using the Looping app: https://zapier.com/apps/looping/help

Userlevel 3
Badge +3

My guess is running a loop to separate a string of data is not an appropriate use of a loop.

 

Userlevel 7
Badge +14

@blueguy

Let’s try a different approach…

Assume there are no other Zap steps yet after the GSheet step, in your own words explain what you are trying to do with the rows of data returned from GSheets.

e.g. For each GSheet row returned I want to do X, Y, Z.

 

###

 

The data from GSheets is returned as an array of items.

If you are trying to iterate thru each GSheet row, then Looping makes sense.

If you are trying to do something else, then we need more context about the purpose of your Zap.

 

Userlevel 3
Badge +3

Troy (meister) 

 

Thanks for the patience.

 

  1. we have a Google sheet with with patient names , facilities and date of upcoming appointment
  2. so I wanted to look up in the Google Sheet all patients who belong to Facility X and have an upcoming appointment on 6.10.2023
  3. This query generated 6 Rows or results that met my query parameters
  4. One of the rows had 6 first names in it and another row had 6 last names (each name is separated by a comma)
  5. Initially, I thought splitting the string of 6 names (that are separated by a comma would work), but it does not
  6. I want to be able to match first name with last name and have the list of 6 patients (who met the above criteria) appear in an email

Thank you again!

Userlevel 7
Badge +14

@blueguy
Which are you trying to do?

  1. Send 1 email that contains info about all the data from the returned GSheet rows
    1. This would use Formatter
  2. Send 1 email for each returned GSheet row
    1. This would used Looping
Userlevel 3
Badge +3

1 email

We will send a single email to one facility and inside that email, we would like to list the names of the patients who have upcoming appointments on a particular date.  So the email could have 3 names in it or 10

 

GML

Userlevel 7
Badge +14

@blueguy 

Try this: Formatter > Utilities > Line Items to Text

 

EXAMPLE

For the Input it shows 2 variables mapped

Each variable is an array, such as would be returned from GSheets.

 

Output Text variable shows the merged data that you can map into the email.

 

For your reference: Different options for handling line items in Zaps:

 

Userlevel 3
Badge +3

Great!! That worked; you are awesome.  Sir!!  

 

Next question if you want to take a crack at it is figuring out how many rows are found in Google Sheets because combining null values will likely stop the Zap process

 

Sometimes the query of the Google Sheet will find 8 matching rows and sometimes it will find 3; so I need to figure out a way to know how many names to put in the email.

 

 

Userlevel 7
Badge +14

@blueguy

Formatter steps will handle a varying amount of rows.

 

This 1 variable output from the Formatter step has all of the array items merged.

 

Userlevel 3
Badge +3

alright that is enough for today; my brain is fried!! 

 

Thank you so much;  you have been great; you have helped out many times before

 

gml