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

Combo Box items from SharePoint list

Dear All,

I have a SharePoint list with the fallowing name:
Projects
I want to work with two columns in PowerApps from "Projects" list:
ProjectName (Column type in SharePoint: Lookup)
ProjectStatus (Column type in SharePoint: additional fields of ProjectName lookup)
I would like to insert all ProjectName to my combo box items, where the ProjectStatus is "Open".

First time I tried with next formula:
Filter('Projects';'ProjectStatus'.Value = "Open").ProjektName
Result: There are 3 items in the combo box (it is correct because there are 3 open projects), but the ProjectName at items is not visible. I have 3 blank lines in my combo box.

The next formula I tried was this:
Filter(Choices('Projects'.ProjektName); LookUp('Projects'; ProjektName.Value = Value).'ProjektName:SelectedStatus'.Value="Open")
Result: It is working properly in runtime mode, but I got the next error message in design mode:
"Unexpected characters. The formula contains 'ParenClose' where 'Eof' is expect"

Can you please help me what can be the problem or the correct formula?
Thanks,
Gabor

4 REPLIES 4
Anonymous
Not applicable

Bumping for visibility 

 

@Anonymous 

Hooze
Helper I
Helper I

In my experience using a combobox with items set directly to a list, things tend to be a bit wonky.

 

A more reliable method I've found is to first collect your list and then set your items to the collection.

 

So in your case you may try putting this formula into your onvisible property of the screen where your ComboBox appears

 

ClearCollect(ProjectsCollect, 'Pojects');

And then use this in the items of your ComboBox

Filter(ProjectsCollect, ProjectStatus = "Open")

Also make sure to set the fields of your combobox appropriately.

 

DisplayFields should read

["ProjectName"]

 

Hope this helps!

Gabor
Frequent Visitor

Thank you for your answer.
I tried this solution, but I didn't get back data at items in combo box.
The problem, no data found in ProjectCollect, when I call it with "Filter(ProjectCollect... at items.

Sounds like it did not collect anything for some reason.

 

After navigating to the screen where your combobox is located,  hit View -> Collections and check your collections for data in 'ProjectsCollect'.

 

If you see nothing, try the collect formula on a button to try and collect manually, see if that changes anything.

ClearCollect(ProjectsCollect, 'Pojects');

If that also does not result in a collection with data, these formulas must be pointing to the wrong name somewhere.

 

Did you use 'ProjectCollect' in the collect fomula, or 'ProjectsCollect'? One letter will make or break!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,179)