cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Powerapps ComboBox picker from SharePoint List

Hello, 

 

I have a ComboBox in power apps that gets the information from a SharePoint List Site:

Distinct('Document Control Approvers',Person.DisplayName)


SharePoint List ( Document Control Approvers).png

This allows me to get the Person (Person field) name from the SharePoint List Site, then what I am trying to do is in PowerApps filter the information based on the Role and Site Locations.PowerApps Form.png

For example if CheckboxSite1 is selected, the Combobox shoud show only Persons which Site Location contains Site 1, and Role is not equal to "Approver"

 

Any help or idias to make it easier will help, I am trying to get the persons that eventually will approve this form using Flow which could be for Site 1 or Site 2 or all of them, so approvals may change.

 

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Powerapps ComboBox picker from SharePoint List

Hi @Isaiah,

Could you please share a bit more about the Role column and Site Location column in your SP list?

I suppose that the Role column and Site Location column are both Choice type column in your SP list, and the Site Location Choice column has enabled "Allow multiple selections" option, is it true?

I have made a test on my side, please take a try with the following workaround:1.JPG

 

2.JPGSet the OnSelect property of the Site 1 Check box (Checkbox1) to following:

If(Checkbox1.Value = true, Collect(SiteCollection, Checkbox1.Text),Remove(SiteCollection, LookUp(SiteCollection, Value = Checkbox1.Text)));
Clear(RecordsCollection);
ForAll(SiteCollection, Collect(RecordsCollection, Filter('20190201_case1', Value in 'Site Location'.Value && Role.Value <> "Approver")))

On your side, you should type:

If(Checkbox1.Value = true, Collect(SiteCollection, Checkbox1.Text),Remove(SiteCollection, LookUp(SiteCollection, Value = Checkbox1.Text)));
Clear(RecordsCollection);
ForAll(SiteCollection, Collect(RecordsCollection, Filter('YourSPList', Value in 'Site Location'.Value && Role.Value <> "Approver")))

Set the OnSelect property of the Site 2 Check box (Checkbox2) to following:

If(Checkbox2.Value=true,Collect(SiteCollection, Checkbox2.Text),Remove(SiteCollection, LookUp(SiteCollection, Value=Checkbox2.Text)));
Clear(RecordsCollection);
ForAll(SiteCollection, Collect(RecordsCollection,Filter('20190201_case1', Value in 'Site Location'.Value && Role.Value<>"Approver")))

On your side, you should type:

If(Checkbox2.Value = true, Collect(SiteCollection, Checkbox2.Text),Remove(SiteCollection, LookUp(SiteCollection, Value = Checkbox2.Text)));
Clear(RecordsCollection);
ForAll(SiteCollection, Collect(RecordsCollection, Filter('YourSPList', Value in 'Site Location'.Value && Role.Value <> "Approver")))

 Set the OnSelect property of the Site 3 Check box (Checkbox3) to following:

If(Checkbox3.Value=true,Collect(SiteCollection, Checkbox3.Text),Remove(SiteCollection, LookUp(SiteCollection, Value=Checkbox3.Text)));
Clear(RecordsCollection);
ForAll(SiteCollection, Collect(RecordsCollection,Filter('20190201_case1', Value in 'Site Location'.Value && Role.Value<>"Approver")))

On your side, you should type:

If(Checkbox3.Value = true, Collect(SiteCollection, Checkbox3.Text),Remove(SiteCollection, LookUp(SiteCollection, Value = Checkbox3.Text)));
Clear(RecordsCollection);
ForAll(SiteCollection, Collect(RecordsCollection, Filter('YourSPList', Value in 'Site Location'.Value && Role.Value <> "Approver")))

Set the Items property of the Combo Box to following:

Distinct(RecordsCollection, Person.DisplayName)

 

 

Above formula within the OnSelect property of the Checkbox control may cause a Delegation issue, in order to get rid of this issue, please consider take a try with the following article:

Set the OnVisible property of the first screen of your app to following:

ClearCollect(YourSPListCollection, 'YourSPList')

Then set the OnSelect property of the Checkbox1 to following:

If(Checkbox1.Value = true, Collect(SiteCollection, Checkbox1.Text),Remove(SiteCollection, LookUp(SiteCollection, Value = Checkbox1.Text)));
Clear(RecordsCollection);
ForAll(SiteCollection, Collect(RecordsCollection, Filter(YourSPListCollection, Value in 'Site Location'.Value && Role.Value <> "Approver")))

set the OnSelect property of Checkbox2 to following:

...

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: Powerapps ComboBox picker from SharePoint List

Thank you Kris,

 

I really approciate the information. However i think more clarification on my end was needed.

 

Yes, the information comes from a SP list. What I would like to achive is the following:

 

1. Power apps contains 3 Sites with 3 combobox, the combobox will only be visible if the user selects the site checkbox.

2. If the checkbox for site 1 is selected, then it will show the users belonging to that site. Please see the example on the attachments.

 

 

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (5,376)