Friday, 30 July 2021

Join Multiple Tables in Canvas App using Lookup

 Hi all,

So, imagine that you have 2 tables

Table A: "Team Assignment" and Table B: "Player", with Player (Display Name: Player and Schema Name is new_playerid) is the Foreign Key



Now, I want to have gallery in CanvasApp that showing the Information:

Team Name, Player Name, and Date of Birth

I have been trying to find the answer and could not find it because typically if you just use lookup and without match the foreign key which is Player Id in this case, you will not get the correct Date of Birth, instead will just get the "first record" which is in the case is 1-Jul-95 (Donny's)

So, here is the answer:

Put the code in the Items property of the Gallery

AddColumns('Team Assignments', 

"PlayerObject", 

LookUp(Players, Player = 'Team Assignments'[@Player].Player))

With this, you can get all the columns from both tables, if you need just one column, you can just add it in the LookUp formula

Reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-table-shaping

Hope it helps!


5 comments:

  1. Hi there I am so delighted I found your weblog, I really found you by accident,
    while I was researching on Bing for something else, Regardless I am here now and would just like to say thank you for a fantastic post and a all round entertaining blog (I also love the theme/design), LEARN MORE I don't have time to go through it all at the minute but I have bookmarked it and also added your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the excellent job.

    ReplyDelete
  2. Hi there, I found your website by means of Google while looking for a
similar matter, your site got here up, it looks great. I have bookmarked it in my google bookmarks. BLUE COOKIES MEDICAL KUSH FOR ALL I have got you bookmarked to look at new stuff you .

    ReplyDelete
  3. Dynamic Netsoft Technologies is a Microsoft gold partner. Reach us, if you looking for Microsoft Dynamics 365 Partners

    ReplyDelete

My Name is..