cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
BB9
Level: Powered On

Excel - Get data and perform actions based on conditions and send customized data from Excel

Hello,

 

I have started to create a very complex conditional flow with the below scenario:

 

We will be provided with an excel with two sheets:

Sheet1 contains Email Ids and Names. These are our leads.

Sheet2 contains Account Holder Name, Account Type, Account Balance, Assigned To. This will have all the types of acount, each account holder will have multiple accounts, different types. Sample data attached. Each account holder will be assigned to a lead from Sheet1.

 

Use Case: Once we trigger using Flow, the goal is to have Flow pull the emails/rows from Sheet1 -> For Each value, get the corresponding rows assigned to in Sheet2, put in a table and send it to the lead in an email. I apologize for making it very confusing.

 

Sheet1:

NameEmail
Name1Email1@email.com
Name2Email2@Email.com
Name3Email3@email.com
Name4Email4@Email.com
Name5Email5@email.com

 

Sheet2:

 

Account Holder NameAccount TypeAccount BalanceAssigned To
PP5Check213Name1
PP1Save345Name2
PP2Check56454Name3
PP3Save2332Name3
PP4Save45Name2
PP1Save43Name1
PP2Check3453Name1

 

For Each value in Sheet1, pull the corresponding values in Sheet 2 and send all of them in an email.

 

Here is the flow I started to create. Not sure what to enter in 'Key Value'. 

Flow screenshot.png

6 REPLIES 6
Community Support Team
Community Support Team

Re: Excel - Get data and perform actions based on conditions and send customized data from Excel

Hi @BB9 ,

 

I assume that you would like to get distinct value for each “Name”.

 

Please check if the following thread could be a reference for you:

https://powerusers.microsoft.com/t5/General-Flow-Discussion/microsoft-flow-get-all-items-with-distin...

 

Best regards,

Mabel          

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BB9
Level: Powered On

Re: Excel - Get data and perform actions based on conditions and send customized data from Excel

Hi Mabel,

 

I have followed all the steps mentioned in the other post, however, as many of them in the same other post mentioned, I am stuck with the below error:

 

Unable to process template language expressions for action 'Apply_to_each' at line '1' and column '2032': 'The template language function 'first' expects its parameter be an array or a string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#first for usage details.'.

 

I have tried all the options but does not seem to be working!

 

@v-yamao-msft 

Community Support Team
Community Support Team

Re: Excel - Get data and perform actions based on conditions and send customized data from Excel

Hi @BB9 ,

 

Could you share an image of your current flow?

 

What’s the function used in this step?

 

The error message says that the value you provided for the first expression is Null. Please make sure the value you used in the function does return a value.

 

Best regards,

Mabel  

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BB9
Level: Powered On

Re: Excel - Get data and perform actions based on conditions and send customized data from Excel

Hi Mabel,

 

Attached is the latest error after I added an "Append to array variable":

Flow New error.pngLatest error0.pngSharePoint list, AssignedTo (Person or Group, multi selection enabled)1.png2.pngCompose - union(variables('BBEmailArray'),variables('BBEmailArray'))3.pngfirst(item()?['AssignedTo'])?['Email'] equalto first(variables('BBEmailArray'))

@v-yamao-msft 

Community Support Team
Community Support Team

Re: Excel - Get data and perform actions based on conditions and send customized data from Excel

Hi @BB9 ,

 

What’s the column type of AssignedTo field? Is it of type People or group?

In the sample thread, it is of type people or group as well.

 

Best regards,

Mabel          

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BB9
Level: Powered On

Re: Excel - Get data and perform actions based on conditions and send customized data from Excel

Hi Mabel,

 

Yes, the column type is Type Person or Group. I have tried both with 'Allow selection of Groups' on and off as well. Flow.png

Helpful resources

Announcements
firstImage

Microsoft Flow Online Conference

Join us for a FULL day of FREE Microsoft Flow Sessions from some of the best minds in the industry!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

thirdImage

New Flow Community Board!

Check out the new Microsoft Flow Community Blog Topic Suggestion board!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 52 members 3,885 guests
Please welcome our newest community members: