web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Online\Offline app - F...
Power Apps
Answered

Online\Offline app - Filtering collection

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello 

My app's database is SP list that contains Choices columns. The App has ability to work at Offline mode by pulling the relevant items to a collection. 

My filter pane contains combo boxes for the choices column values. 

 

I am failing to implement the mentioned CB for filtering the collection columns that pulled the information from the Choices column type. 

 

Will appreciate your assistance. 

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,275 Most Valuable Professional on at

    Hi @Anonymous ,

    That is because the Choices() function only exists when looking directly at the SharePoint list - it is actually looking at the Field definition, not the Field content. A collection only contains the content. As you have "hard coded" the choices in SharePoint, do the same in the app (I do anyway - I do not use Choice columns unless storing multiple choices)

    If(
     Connection.Connected,
     Choices(ListName.FieldName),
     ["Choice1","Choice2","Choice3"," . . . . "]
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz 

    I get your point. Looks like it still not working.  

    I do agree that it is always end up to be more convenient avoid using Choice columns. 

    For the online version I am using the following:

    Or( 

    IsBlank(cb_Validation.SelectedItems),
    IsEmpty(cb_Validation.SelectedItems),
    Inspected.Value = Last(FirstN(cb_Validation.SelectedItems,1)).Value,
    Inspected.Value = Last(FirstN(cb_Validation.SelectedItems,2)).Value,
    Inspected.Value = Last(FirstN(cb_Validation.SelectedItems,3)).Value,
    Inspected.Value = Last(FirstN(cb_Validation.SelectedItems,4)).Value )

     

    Looks like it doesn't work for the collection.  

  • Verified answer
    WarrenBelz Profile Picture
    156,275 Most Valuable Professional on at

    Hi @Anonymous ,

    You do not actually need it if you are filtering a collection as the filter is processed "locally"

    Filter(
     YourCollection,
     Or( 
     Len(cb_Validation.Selected.Value) = 0,
     Inspected.Value in cb_Validation.SelectedItems
     )
    )

    You can also shorten your code a bit

    Or( 
     Len(cb_Validation.Selected.Value) = 0,
     Inspected.Value = First(cb_Validation.SelectedItems).Value,
     Inspected.Value = Index(cb_Validation.SelectedItems,2).Value,
     Inspected.Value = Index(cb_Validation.SelectedItems,3).Value,
     Inspected.Value = Index(cb_Validation.SelectedItems,4).Value
    )

    I also have another approach in this blog of mine which can also be used directly on a list with Delegation only limited to the items returned on each of your item choices (it will work fine as long the total output is under this)

    If(
     Len(cb_Validation.Selected.Value) = 0,
     YourCollection,
     Ungroup(
     ForAll(
     cb_Validation.SelectedItems As aSel,
     Filter(
     YourCollection,
     Inspected.Value = aSel.Value
     )
     ),
     "Value"
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks @WarrenBelz !

     

    Works perfect

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 421 Most Valuable Professional

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard