web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Creating a relationshi...
Power Apps
Unanswered

Creating a relationship between two tables

(0) ShareShare
ReportReport
Posted on by

Hello,

I am new to Power App creation and have a problem merging two tables using a common column in order to display the supportive information to the end-users.

Main Info Table

222lovebirds_0-1637101698712.png

 

Supportive Info Table

table2format.png

I have a Main Info Table and Supportive Info Table. They are each in a separate excel sheet.

The Main Table is used to create a gallery on the startup page. By clicking an arrow on the gallery, it goes to a project profile details page. There, the selected item’s information is displayed from the Main Info Table.

 

In addition to data from the Main Info Table, I need to get people who are associated with the selected project from the Supportive Info Table and display their names and contact info in the red highlighted area below Project Team if there is a ‘Project_Number & project_number’ match between the Main Info Table and Supportive Info Table.

222lovebirds_2-1637101776026.png

222lovebirds_3-1637101795676.png

Any suggestions or help would be greatly appreciated.

Thanks,

222lovebirds

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,290 Most Valuable Professional on at

    Hi @222lovebirds ,

    If you put a label in the gallery which is (I assume based on 'Main Info Table' and Project_Number is the common linking field, then as an example, this in the Text will get you Role(#)

    LookUp(
     'Supportive Info Table',
     Project_Number = ThisItem.Project_Number
    )'Role(#)'

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • WarrenBelz Profile Picture
    155,290 Most Valuable Professional on at

    Hi @222lovebirds ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • RL-23102031-0 Profile Picture
    on at

    Hello, @WarrenBelz and thank you for your help. I am going to have to update the original question because the datasheet format has been changed. Please allow me about a week to update it. I appreciate your help and support!!

  • RL-23102031-0 Profile Picture
    on at

    Here is what I am trying now. I've added the code to 'App' - 'OnStart' to combine two tables and look up the match to display the project team members but all 'collection'(s) created in the code come back empty therefore I can't use them to display information on the app. What am I missing here? Are there better approaches to solve it?

    ClearCollect(
    ProjectCollection,
    GroupBy(
    MainInfoTable,
    "Project_Name",
    "Project_Number",
    "ProjectInfoGrouped"
    ));
    ClearCollect(
    EmployeeCollection,
    GroupBy(
    SupportiveInfoTable,
    "project_name",
    "project_number",
    "ProjectTeamGrouped"
    ));
    ClearCollect(MasterCollection,AddColumns(ProjectCollection,"ProjectTeamGrouped",LookUp(EmployeeCollection, project_number=ProjectCollection[@Project_Number],ProjectTeamGrouped)));

    ------------------------------------------------------------------------------------------

    Note: I am getting an 'Incompatible types in comparison' error message here. Just in case, if the error is about the column type, both project_number and Project_Number columns are set to 'Text' on tables...

    Thank you for your help in advance!

  • WarrenBelz Profile Picture
    155,290 Most Valuable Professional on at

    Hi @222lovebirds ,

    Firstly try this - also confirm that Project Number in both is a Single Line of Text.

    With(
     {
     wProject:
     GroupBy(
     MainInfoTable,
     "Project_Name",
     "Project_Number",
     "ProjectInfoGrouped"
     ),
     wEmployee:
     RenameColumns(
     GroupBy(
     SupportiveInfoTable,
     "project_name",
     "project_number",
     "ProjectTeamGrouped"
     ),
     "project_number",
     "ProjectNumber"
     )
     },
     ClearCollect(
     MasterCollection,
     AddColumns(
     wProject,
     "ProjectTeamGrouped",
     LookUp(
     wEmployee, 
     ProjectNumber = Project_Number
     ).ProjectTeamGrouped
     )
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • RL-23102031-0 Profile Picture
    on at

    Thank you, @WarrenBelz. The error message is gone 👍, but the MasterCollection comes back empty... Any suggestions?

    222lovebirds_0-1638487361139.png

     

  • WarrenBelz Profile Picture
    155,290 Most Valuable Professional on at

    Hi @222lovebirds ,

    It appears to be valid syntax for what you are doing - are you sure this filter produces records

    LookUp(
     wEmployee, 
     ProjectNumber = Project_Number
    )

    and also how many records are there in each list?

  • RL-23102031-0 Profile Picture
    on at

    Hi @WarrenBelz. Thank you for your reply. I am not sure if this answers your question but here is what I see. Those grouped columns look empty. Also, the main table has 301 rows, and the supportive table has 286 rows. Thank you for your help!

    222lovebirds_0-1638552575867.png

     

  • WarrenBelz Profile Picture
    155,290 Most Valuable Professional on at

    Hi @222lovebirds ,

    The reason for the list numbers was that GroupBy will only work on up to your Delegation limit, but that is not an issue here. Also by your post

    DoubleGroupBy.jpg

    the tables are populated, so the collection worked in that respect - it has me baffled a bit why the other columns are empty - so for a bit of debugging, go back to the "long" way and see what is in the three collections.

    ClearCollect(
     ProjectCollection,
     GroupBy(
     MainInfoTable,
     "Project_Name",
     "Project_Number",
     "ProjectInfoGrouped"
     )
    );
    ClearCollect(
     EmployeeCollection,
     GroupBy(
     RenameColumns(
     SupportiveInfoTable,
     "project_number",
     "ProjectNumber"
     ),
     "project_name",
     "ProjectNumber",
     "ProjectTeamGrouped"
     ),
    );
    ClearCollect(
     MasterCollection,
     AddColumns(
     ProjectCollection,
     "ProjectTeamGrouped",
     LookUp(
     EmployeeCollection, 
     ProjectNumber = Project_Number
     ).ProjectTeamGrouped
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • RL-23102031-0 Profile Picture
    on at

    Thank you for your help, @WarrenBelz. I didn't change the code but I no longer see the MasterCollection populated with empty columns... It comes back as 'We didn't find any data,' and the message is consistent across all collections. The collections are created but don't contain any data. Please see attached images.

     

    The new fields appear under ThisItem. but also empty.
    columnsInCollections.png

    columnsInCollections.png
    collections.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,045

#2
Valantis Profile Picture

Valantis 675

#3
11manish Profile Picture

11manish 592

Last 30 days Overall leaderboard