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 / ComboBox to filter Gal...
Power Apps
Answered

ComboBox to filter Gallery by ID

(0) ShareShare
ReportReport
Posted on by 85

I have a Gallery that I want users to be able to search by ID.  I created a collection to get the ID and store it in a combo box plus added the value "All".  With the function I have, I am only seeing "All" in the Value and the ID in Result within the collection.  Therefore, "All" is the only value displaying in the combo box.  I have tried using Value in place of Result to see if it will put the ID in the Value column, as well. How can I get the ID in the combo box for search purposes?  Thank you in advance for your assistance.

 

 

 

ClearCollect(
colCID,
{Value:"All"},
{Result:('AIMS Q & A'.ID)}
);

 

 

Categories:
I have the same question (0)
  • PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at

    @IntraAdmin Would you please try 

    ClearCollect (colCID, {Value:"All"}); ForAll('AIMS Q & A' As Master

    Collect(colCID,{Value: Master.ID}));

  • IntraAdmin Profile Picture
    85 on at

    @PriyankaGeethik  I tried your function but I am receiving an error on the ForAll function As is not permitted in this context.

     

  • PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at

    Would you please explain if 'AIMS Q &A' is collection or DataSource ? if it is not a collection would you please try adding the source in collection and then in ForAll use this collection ?

  • IntraAdmin Profile Picture
    85 on at

    @PriyankaGeethik @RandyHayes @WarrenBelz  It's a data source.  I hate to add a whole data source to a collection.  Won't that effect performance?  I will try, though.

     

  • WarrenBelz Profile Picture
    156,127 Most Valuable Professional on at

    @IntraAdmin ,

    Firstly try a comma after Master, but this solution is subject to Delegation numbers (it will only add the first 500-2,000 records fields from the data source). If you want the newest record, you can do this

    ClearCollect (
     colCID, 
     {Value:"All"}
    ); 
    ForAll(
     Sort(
     'AIMS Q & A' As aList,
     ID,
     Descending
     ),
     Collect(
     colCID,
     {Value: Text(aList.ID)}
     )
    )

     

    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.

  • IntraAdmin Profile Picture
    85 on at

    @WarrenBelz @PriyankaGeethik Both are throwing an error with comma after Master in the code Priyanka shared and with the code Warren shared.  The errors on both are attached.  I am researching as we speak.  We don't see delegation as an issue as we do not expect 2,000 items. This was an emergency project that needs to be completed tomorrow and was assigned Monday late afternoon.  Hence, the urgency.

     

     

    PriyankaError.png
    WarrenError.png
  • WarrenBelz Profile Picture
    156,127 Most Valuable Professional on at

    @IntraAdmin ,

    Fixed on my post - problem with free-typing it needs a Text 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.

  • IntraAdmin Profile Picture
    85 on at

    Thank you so much for your help @PriyankaGeethik @WarrenBelz  I have made multiple attempts to convert ID to text.  In the Sort, ID needed to be "ID"  and has been converted to text but I cannot get the VAlue in the Collect function to convert the aList.ID to text.  In that Collect function is the only error which states that the Value column in the data source expects a Text type and you're using an Error type.

    ClearCollect (
     colCID, 
     {Value:"All"}
    ); 
    ForAll(
     Sort(
     'AIMS Q & A' As aList,
     Text("ID"),
     Descending
     ),
     Collect(
     colCID,
     {Value: Text(aList.ID)}
     )
    );

     

  • WarrenBelz Profile Picture
    156,127 Most Valuable Professional on at

    @IntraAdmin ,

    You cannot have "All" which is text in the same field as the ID, which is numeric.

    Why are your sorting by Text(ID) - you only need to sort by ID to get the newest records,

  • IntraAdmin Profile Picture
    85 on at

    @WarrenBelz I want to have ALL as a choice in the combo box for search purposes so that users can search the Gallery1 by ID or show all items if ALL is chosen.  Can we have a blank that will show all?  I am getting an error if I don't have Text(ID) in the sort function.  I am also getting an error in the Collect function.  See image.

    Search items all work except for IDSearch items all work except for ID

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 166

#3
sannavajjala87 Profile Picture

sannavajjala87 71 Super User 2026 Season 1

Last 30 days Overall leaderboard