Hello everyone! I'm new to PowerApps and want to first say thanks for the wealth of knowledge shared in these forums.
I've setup an app using several tables, as a simple example:
Table1: ID, Student, Grade
Table2: ID, Math, Reading
The app gallery uses data from Table1. After choosing a gallery item, I would like to populate a "Label" where the text is a "score" from Table2 based on the selected gallery item. I'm not sure where to begin with this and I haven't been able to find any solutions to similar questions that worked for this situation.
Thanks in advance for the support.
Solved! Go to Solution.
Hi @loepan ,
How do you set up the relationship between the two Tables? Through ID column?
If you want to retrieve corresponding info from another table from one table, you must make sure you have set up a relationship between the two tables through column value.
I assume that the two Tables owns common ID column value, they are related through the ID column. Based on the needs that you mentioned, I think the LookUp function could achieve your needs.
Add a Label in your app, set the Text property to following (retrieve Math score):
LookUp(Table2, ID = Gallery1.Selected.ID, Math)
or
LookUp(Table2, ID = Gallery1.Selected.ID).Math
If you want to retrieve the Reading score from the Table2, please try the following formula:
LookUp(Table2, ID = Gallery1.Selected.ID, Reading)
Best regards,
Hi @loepan
What you are describing is a classic many to many relationship. It requires three tables to model it. The third table is called a junction table.
Hi @loepan ,
How do you set up the relationship between the two Tables? Through ID column?
If you want to retrieve corresponding info from another table from one table, you must make sure you have set up a relationship between the two tables through column value.
I assume that the two Tables owns common ID column value, they are related through the ID column. Based on the needs that you mentioned, I think the LookUp function could achieve your needs.
Add a Label in your app, set the Text property to following (retrieve Math score):
LookUp(Table2, ID = Gallery1.Selected.ID, Math)
or
LookUp(Table2, ID = Gallery1.Selected.ID).Math
If you want to retrieve the Reading score from the Table2, please try the following formula:
LookUp(Table2, ID = Gallery1.Selected.ID, Reading)
Best regards,
Thanks for the response. This is really helpful. I have not setup a relationship between the two tables. Both tables are located in Excel Files in OneDrive for Business. What is the best move forward for setting up a relationship between these two tables? Should I move the data to a CDS or is there is way to do it through Excel? If a CDS, can you recommend a guide that's beginner friendly?
Thanks again.
Hi @loepan ,
If the ID column in your Table1 represents the Student ID, you could consider add a column in your Table2 called "studentID" to reference values from the ID column in your Table1 (you need to enter the value in studentID column manually). Then this relationship would be set up. After that, you could use above solution I provided in your scenario.
In addition, you could consider create two SP Lists as your data source. Then within SP List2, you could defined a LookUp type column to reference values from the ID column in your SP List1.
Best regards,
Thank you! This worked perfectly.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
258 | |
122 | |
85 | |
75 | |
72 |