cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
carl1to
Resolver I
Resolver I

Filter Lookup Combobox based on selected Value (Sharepoint Form)

I try to create a form for my list where I filter combobox selection based on a different lookup field on this form. Despite looking on various posts with similar problems, I could not find a working solution.

 

3 Tables:

  • Organization (Title=Text)
  • Department (Title=Text, Organization=Lookup to Organization)
  • Incident (Title = Text, Organization = Lookup to Organization, Department = Lookup to Department)

I would like to filter the selection of department-combobox based on the preselected organization-combobox value in the incident form. What is the formula for the 'Items'?

Table OrganizationTable Organization carl1to_1-1643095613149.png carl1to_3-1643095748129.png

carl1to_4-1643095908034.png

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
carl1to
Resolver I
Resolver I

Somehow the form requires a Choices() (=Table with Id, Value). I could accomplish the filter task with the follow item definitions:

Organization:

Choices([@Incident].Organization)

Department: 

Filter(Choices([@Incident].Department), Value in Filter(Department_1, Organization.Value = cbOrganization.Selected.Value).Title)

 

View solution in original post

5 REPLIES 5
zmansuri
Super User
Super User

a3.jpga2.jpga.jpga1.jpg

 

 

Distinct(Organization,Title).Result

 

Filter(Department,Organization.Value=ComboBox1.Selected.Result).Title

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


Was I helpful? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. It will help other users to find it faster.

follow me on Twitter @zmansuri123,
connect with me on LinkedIn from Here

Thank you zmansuri!

This works fine in the the preview, but when I want to use this form (publish to sharepoint site), the selected values in the combobox are not saved into the form. What is the issue here?

carl1to_1-1643098541811.png

 

 

carl1to
Resolver I
Resolver I

Somehow the form requires a Choices() (=Table with Id, Value). I could accomplish the filter task with the follow item definitions:

Organization:

Choices([@Incident].Organization)

Department: 

Filter(Choices([@Incident].Department), Value in Filter(Department_1, Organization.Value = cbOrganization.Selected.Value).Title)

 

You started your post with "I try to create a form for my list". I assumed you were creating PowerApps form and not SharePoint form. Because majority of the questions here are related to that. 

 

Yes the code you have posted should work for that scenario. 

 

If it worked out close the thread by clicking Accept as Solution

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


Was I helpful? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. It will help other users to find it faster.

follow me on Twitter @zmansuri123,
connect with me on LinkedIn from Here

Sorry, I was not precise with my initial question. 

But thank you for your help. Your answer for a PowerApps form helped me to narrow down my google searches. And maybe, I will create a PowerApp for this case in the next stage anyway!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,639)