cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
cooper33
Level 8

Add item to Drop Down List

Trying to add an All option to my drop down list (SharePoint choice - radio field). I have seen a lot of posts on this but can't get it to work

This syntax (mentioned in this thread) seems the simplest: [ *yourdatasourceitems*, "yourcustomitem"]  syntax work?

 

I tried plugging this into the Items property of my Drop Down which is not working:

["All", Choices('SP List'.ChoiceField)]

 

I have also seen a lot of examples of using Collect() and ClearCollect but I can't get that quite right. Solution from that thread:

ClearCollect(BCategory, {Result:"All"});Collect(BCategory,Distinct('WPE Budget Category',BudgetCategory))

I can't tell what all of these values are supposed to represent (ex BCategory vs BudgetCategory, what is Result). This is kind of what I have been tring on my end in generic terms but can't get it to work

ClearCollect(newCollectionName, {Result:"All"});Collect(newCollectionName,Distinct('SharePoint List', ChoiceField.Value))

 

Can anyone provide guidance on either of these options?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Add item to Drop Down List

Hi @cooper33

 

Sorry that nobody responded to you at the time, I'm just going through and clearing up older questions and came across this.

 

To resolve this you would need to use the following code onVisible to generate the collection:

 

ClearCollect( ChoiceOptions, {Value: "ALL"}, Choices( SPList.ChoiceColumn ) )

 

Then your items field for your combobox becomes ChoiceOptions,

 

Kind Regards,

Sancho




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!

View solution in original post

1 REPLY 1
Super User
Super User

Re: Add item to Drop Down List

Hi @cooper33

 

Sorry that nobody responded to you at the time, I'm just going through and clearing up older questions and came across this.

 

To resolve this you would need to use the following code onVisible to generate the collection:

 

ClearCollect( ChoiceOptions, {Value: "ALL"}, Choices( SPList.ChoiceColumn ) )

 

Then your items field for your combobox becomes ChoiceOptions,

 

Kind Regards,

Sancho




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,500)