cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
carrigan
Frequent Visitor

Use Google Spreadsheet with Google Drive folder to send multiple attachments to user

I want to build a flow that is looking at a spreadsheet (Google Sheets) and a Google Drive Folder.  In my spreadsheet, I have 2 columns named "ReportName" and "Email".  In my Google Drive Folder I have about 50 reports to choose from.  I want to look at each row in the spreadsheet and email all the reports from Google Drive to that person.  I put a table below as an example of what I have.  You can assume that the Google Drive Folder file names/reports are named the same as the report name on the spreadsheet.  So in Google Drive, the report name for "GoogleReport1" is GoogleReport1.pdf.  I have tried for a couple days but I cannot figure out how to get a flow to run and look at each row and combine all the reports for, lets say john@email.com,  then look for all his reports in Google Drive Folder and email them to him.  I am thinking there is a way to build an array but pulling from two sources is over my beginners head. Any help would be great.  

 

ReportNameEmail
GoogleReport1john@email.com
GoogleReport2john@email.com
GoogleReport3john@email.com
GoogleReport1janedoe@email.com
GoogleReport1joe@email.com
GoogleReport2joe@email.com

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @carrigan ,

 

I've made a test for your reference:

 

1\My Google sheet

vbofengmsft_0-1656647179953.png

2\My Google Drive

vbofengmsft_1-1656647214531.png

3\My flow

vbofengmsft_2-1656647228885.pngvbofengmsft_3-1656647236792.png

 

 

vbofengmsft_4-1656647243762.png

vbofengmsft_5-1656647252936.png

 

4\Result

vbofengmsft_6-1656647313132.png

 

Best Regards,

Bof

 

 

View solution in original post

4 REPLIES 4
v-bofeng-msft
Community Support
Community Support

Hi @carrigan ,

 

I've made a test for your reference:

 

1\My Google sheet

vbofengmsft_0-1656647179953.png

2\My Google Drive

vbofengmsft_1-1656647214531.png

3\My flow

vbofengmsft_2-1656647228885.pngvbofengmsft_3-1656647236792.png

 

 

vbofengmsft_4-1656647243762.png

vbofengmsft_5-1656647252936.png

 

4\Result

vbofengmsft_6-1656647313132.png

 

Best Regards,

Bof

 

 

I could be overlooking it but what do the expressions you are using look like?  

Hi @carrigan ,

 

Sorry , here is the expressions.

 

1\union(body('Select_2'),body('Select_2'))

2\items('Apply_to_each')['Email']

3\item()['ReportName']

4\items('Apply_to_each')['Email']

 

Best Regards,

Bof

I wrote it up exactly like you did and it works perfectly!!  However, if I modify the name of the ReportName in the spreadsheet, say I change the name of "text1.txt" on the spreadsheet to "text1", it only finds text2.txt and attaches it.  Is there a limitation to the "contains" rule I am missing? Also, I used a few more files with multiple email addresses, that is what you are seeing in my filter array 2 input.

 

I make a small change to name on spreadsheet to report name.

carrigan_3-1657216688216.png

 

Join Output is right.

 

carrigan_0-1657216120625.png

 

 

Filter array input..

 

carrigan_2-1657216615975.png

 

Filter Array output only shows test2.txt.  

carrigan_4-1657216794526.png

 

 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,704)