How to create a form in PowerApps where you needed to filter the options available in the drop down depending on an option selected in a different field.
- Create a datasource Contact List_1 which is a list of contacts in SharePoint
- Create a datasource Opportunities which uses SharePoint list called Opportunities
- The both Opportunities and Contact List have a lookup column called Client
- The Contact list has a single line of text column, Fullname
- Your Opportunity list has multi select lookup column, OpportunityContacts
Now, you need PowerApp to show only the contacts relevant to the client selected. Use the Filter function by looking in the Contact List 1 datasource if the Company name matches the client name in opportunity.
Filter(Choices(Opportunities.OpportunityContacts), Value in <List of contacts>)
To filter the list of contacts by the Company name you have to look at the data coming from the ‘Contact List 1’ datasource and filter by Company name and rerturn the full name of the contact.
Put all the differnt elemtns together:
Filter(Choices(Opportunities.OpportunityContacts),Value in Filter(‘Contact List_1’, Company = DataCardValueClient.Text).FullName )
Now you get a drop down that lists only relevant contacts for a client.