cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Basic binding SharePoint list to drop-down

I see tons of posts on how to do cascading drop-down menus but I am not finding anything on how to create a simple drop-down menu in PowerApps from a SharePoint list. I have found it to be easy to create one from SQL Server and I assumed a SharePoint one would be easier but I was wrong.

 

I pulled my drop-down values into separate SharePoint lists so the end users could easily manage the contents of the drop-down menus. I thought the quick part would be connecting to the data sources in PowerApps and boom the drop-down menus would be done. I can tell I am truly connecting to the correct list and field as it shows up but when I try to click on the drop-down menu, instead of getting a drop-down it immediately assigns the first item in my list to the field and I cannot change it. Any Ideas as to what I am doing wrong?

 

I added the data sources for each drop-down and connected to it via the Data source. Then in Fields, I selected the correct field in the data source.

 

I think I'm missing something simple

 

Connection SettingsConnection Settings

2 ACCEPTED SOLUTIONS

Accepted Solutions
KrishnaV
Super User III
Super User III

Hi @Anonymous ,

 

select the dropdown control and set the items property as below:
Choices(SharePointlist.columnname) // Mention the choice column name you want to show the options you want to show as part of dropdown

distinct(Filter(SharePointlist,ID>0),Title)) // This will get all the titles as part of dropdown

 


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

Hi @Anonymous ,

 

try this:

Distinct(Sort(Variety,Title,Ascending),Title)

 Note: this has to be in Items property of the Dropdown List.

 


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

15 REPLIES 15
KrishnaV
Super User III
Super User III

Hi @Anonymous ,

 

select the dropdown control and set the items property as below:
Choices(SharePointlist.columnname) // Mention the choice column name you want to show the options you want to show as part of dropdown

distinct(Filter(SharePointlist,ID>0),Title)) // This will get all the titles as part of dropdown

 


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

mcin9781
Microsoft
Microsoft

Also you can check the default value,  I reproduced the scenario and didn't have a problem with the default value being blank.  Below are the properties that are set when I created the App from SharePoint for the drop down list field.  If this helps with solving your issue please mark it as a suggested answer.

SharePointDropDown.PNG

Anonymous
Not applicable

Krishna,

 

I tried the first solution:

Choices(RequestedBy.Title)

 

It showed no errors but the drop-down still did not function

 

This solution you recommended worked perfectly after I removed the extra right bracket

Distinct(Filter(RequestedBy,ID>0),Title)

 

Thanks for your awesome solution! I am sure others will fine it valuable as well. I searched for this simple solution and could not find it anywhere.

 

-Greg Guth

Anonymous
Not applicable

One quick question,

How would you sort that alpha? I know that will be the first thing that I get asked...

Does the sort go on the onSelect event or add it to this formula?

 

I tried OnSelect with little to no luck Sort( Variety, Title, SortOrder.Ascending ) It says it can't find any data

 

-Greg

Hi @Anonymous ,

 

Add it to the formula as below: 

 

 

Sort(Distinct(Filter(RequestedBy,ID>0),Title),Title,Assending)
Ex:Sort(Choices(SampleList.Status),Value,Ascending)

 

 

Items property of the dropdown, not onChange / onSelect.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

Hi @Anonymous ,

 

Sorry Greg I have updated the formula so that you can use it as it is....

 

I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.
Anonymous
Not applicable

I am getting an empty drop-down as result using both 

Sort(Distinct(Filter(RequestedBy,ID>0),Title),Title,Assending)

or 

Sort( Variety, Title, SortOrder.Ascending )

 

Both give this result:

EmptySortResult.PNG 

Hi @Anonymous ,

 

In the below formula what RequestedBy??? is it a SharePoint list or a column?

Sort(Distinct(Filter(RequestedBy,ID>0),Title),Title,Assending)

 See this below:

Syntax:
Sort(Distinct(Filter(SharePointListName,<<condition>>),SharePOintColumn),SharePOintColumn,Assending)
ex:
Sort(Distinct(Filter(SampleList,ID>0),Title),Title,Assending)

Coming this:

Sort( Variety, Title, SortOrder.Ascending) -----> Change this to:
Sort( Variety, Title, Ascending) // I am assuming Variety is a Sharepoint list or any other Ddatasource list


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.
Anonymous
Not applicable

Sorry, I should have explained better. I created a bunch of lists in SharePoint for each of the dropdowns. I have a list called Departments, RequestedBy and Variety. All of them use the default "Title" field to list their fields.

I followed your example:

Syntax:
Sort(Distinct(Filter(SharePointListName,<<condition>>),SharePOintColumn),SharePOintColumn,Assending)

 Sort(Distinct(Filter(Variety,ID>0),Title),Title,Assending)

I am still getting no values in the drop-down

 

This also gave same negative results: 

Sort( Variety, Title, Ascending)

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (35,428)