cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
P_SA
Helper V
Helper V

Fetch a value by looking up values from two tables

Hello, Can someone help me with the formula to fetch a value using lookup .

 

Below is my table structure. 

I want to fetch the email value from table 2 based on the bank name. 

 

if Bank1 same in both tables , then fetch user 1 from  table 2 and so on.  Kindly help.  Thanks in advance. 

 

P_SA_2-1620022902100.png

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

THanks,  I got it working.

View solution in original post

2 REPLIES 2
RusselThomas
Microsoft
Microsoft

Hi @P_SA ,

So, presumably you're placing the name of the Bank for the current record in Table1 into a variable for a 1-time lookup - or does "and so on" mean you want to run through the whole table and do it for each, collecting the results of all lookups somewhere?

In the first case;

//there needs to be some sort of context for your Table1 Bank name for a one-time lookup
//Let's assume for now it's just the first row's "Bank" field
UpdateContext({varBank: First(Table1).Bank});

//then your lookup would look something like this
LookUp(Table2, Bank = varBank, Email)

It will just return a Blank() value if it can't find it, so you can wrap the lookup in an If() statement as well

If( IsBlank(
             LookUp(Table2, Bank = varBank, Email)
           ), 
        do something if true,
        do something if false
)

Otherwise if you want to loop through all of them you could use a ForAll() function instead and collect the results for all of them somewhere...?

 

Kind regards,

RT

THanks,  I got it working.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,211)