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 / Autofill lookup field ...
Power Apps
Answered

Autofill lookup field and select gallery items based on other table selected value

(0) ShareShare
ReportReport
Posted on by 9

Hi, 

I have created an app that is becoming more and more complex. For this next step I have some trouble figuring out how to make it work and can't seem to find the solution anywhere. Hope someone can help. 

 

What I need is the following:

1) 

- On AppPage1: Gallery1: List “TeamNames” from Table A

- On AppPage2: Gallery2: List all “TeamMembers” from Table B where TableA(TeamName)=TableB(TeamName) based on Gallery1.selected.

2) 

- AppPage2: Form1: Add Person/Team member (I have this)

- AppPage2: Submit the team member into Table B with the “Team” lookup value.

 

My simplified tables look like this and are both SharePoint lists:

Table A:

Field 1: “TeamName”

Field 2: “Team description”

 

Table B:

Field 1: "Team" (Lookup field -> Table A, “TeamName”)

Field 2: "Person" («Person&Group»)

 

I have created two different SharePoint lists in order to show distinct team names on Page 1 without using any filtering. Using the lookup value in SharePoint also lets me delete all members from a team in Table B if the team itself is deleted in Table A.

 

I get it to work fine if I don’t use LookUp value in Table B, as I then can use the .text version of the items in Table A. However, I’m having trouble understanding the .Id type and getting it to work. Specially how I can convert the Table A “TeamName”.text into a chosen “TeamName”.id in table B.  

 

Table B "TeamName" is created in a different form on Page1. People then see their team added to the list in Gallery1, chooses their team (Gallery1.selected) and then navigates to page 2 to add members to the team.

 

Thanks 😊

Categories:
I have the same question (0)
  • Verified answer
    tstenberg Profile Picture
    9 on at

    Solved this one myself eventually. Here's my solution:

     

    Question 1) 

    - On AppPage1: Gallery1: List “TeamNames” from Table A

    - On AppPage2: Gallery2: List all “TeamMembers” from Table B where TableA(TeamName)=TableB(TeamName) based on Gallery1.selected.

     

    Solution 1)

    1) I created a variable for gallery1 selected value. OnSelect:

     

    Set(_Team,Gallery1.Selected)

     

    2) 

    Gallery2 Items

     

    Filter(TableB,_Var.TeamName=Team.Value)

     

     

    Question 2) 

    - AppPage2: Form1: Add Person/Team member (I have this)

    - AppPage2: Submit the team member into Table B with the “Team” lookup value.

     

    Solution 2)

    For the Form1 field "Team", set DefaultSelectedItem:

    If(
     Form1.Mode = FormMode.New,
     LookUp(
     Choices([@TableB].Team),
     Value = DataCardValue12.Text),
     Parent.Default)

    Note: DatacardValue12 is a field in Form2 which is set to FormMode.View to show the enduser which team he is adding the new teammember to.

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard