cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TarenBhutch
Helper I
Helper I

Collection for number values incl. "All" option for drop-down

Hi,

 

I would like to know how to create a collection for a drop-down against a number value column that contains an “All” option.

 

Columns:

Location ID - Choice

Unit number - number

 

Previously, the unit number column in the SPO list was a single line text field. However, we encountered issues of users entering data incorrectly and also were not able to sort the values, so changed the column to a number value. The below code was allowing an “All” option to be selectable when the column was a single line text field.

 

OnVisible =

ClearCollect(colLocation, {Result:"All"});

    Collect(colLocation, Sort(Distinct('ListName',Location.Value),Result));

ClearCollect(colUnit,{Result:"All"});

    ClearCollect(colUnit, Sort(Distinct('ListName', 'Unit number'),Result));

 

TarenBhutch_0-1630893717786.png

 

Thank in advanced!

2 REPLIES 2
nish5562
Frequent Visitor

Make use of combo box and add filters of isbank and isempty for all components of the list and make use of distinct and sort by column to sort data in combobox 

v-bofeng-msft
Community Support
Community Support

Hi @TarenBhutch :

Please set the gallery's items property to:

If(
  'Location ID Combobox'.Selected.Result="All" && 'Unit number Combobox'.Selected.Result="All",
  ListName,
  'Location ID Combobox'.Selected.Result="All",
  Filter(ListName,'Unit number'='Unit number Combobox'.Selected.Result),
  'Unit number Combobox'.Selected.Result="All",
  Filter(ListName,Location.Value='Location ID Combobox'.Selected.Result),
  Filter(ListName,'Unit number'='Unit number Combobox'.Selected.Result && 'Location ID Combobox'.Selected.Result)
)

Best Regards,

Bof

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,627)