I have a PowerApps form connected to a SharePoint Online list. My SharePoint list titled "Log" has a multi-select Choice column named "Service", which appears in PowerApps as a combo-box. The user can select 1 or more "Services" from this combo-box. Based on the selection of services, a number of related "Agencies" should appear in a Gallery on the form. The Agencies are defined against each Service in the Services list.
Log List:
- Services: Multi-select lookup
Service List:
- Title
- Agency (Multi-select Choice, all possible agencies for this Service)
While I can get the selected services from the combo box, the problem is that I am unable to retrieve the values from the Agency multi-select Choice field in the same list. What I have tried is to get the selected Services from the dcvServices control (into SelectedServices) and then collect the related Agency values (into AvailableAgencies) during the OnSelect of the Service dropdown:
ClearCollect(SelectedServices, Filter([@Service], Title in dcvServices.SelectedItems.Value));
ClearCollect(AvailableAgencies, SelectedServices.Agency);
When I try to hook up my Gallery control to the AvailableAgencies collection, I can't quite getthe Agency values to display. I get the following error: