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
Page 1 / 1
Hi @blueguy
We need more context about how you are trying to use the returned GSheet row data in following Zap action steps. (screenshots)
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.
My guess is running a loop to separate a string of data is not an appropriate use of a loop.
@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.
Troy (meister)
Thanks for the patience.
we have a Google sheet with with patient names , facilities and date of upcoming appointment
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
This query generated 6 Rows or results that met my query parameters
One of the rows had 6 first names in it and another row had 6 last names (each name is separated by a comma)
Initially, I thought splitting the string of 6 names (that are separated by a comma would work), but it does not
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!
@blueguy Which are you trying to do?
Send 1 email that contains info about all the data from the returned GSheet rows
This would use Formatter
Send 1 email for each returned GSheet row
This would used Looping
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
@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:
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.
@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.
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