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 / Create a Collection by...
Power Apps
Answered

Create a Collection by filtering Gallery

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello

 

I am trying to create a collection from a gallery (take QTY not blank or zero).

There is a lot of text boxes in my gallery but I would like to take itemno, qty and price only.

 

I would like to make a collection list "mylist_" list form  filtering QTY

 

This is my formula but not working how I would like to do.

Clear(mylist_); ForAll(Filter(Gallery6.AllItems,ThisRecord.txt_qty>=0),Collect(mylist_),{itemno:txt_itemno,QTY:txt_qty,prie:txt_price}))

 

Thanks,

 

Categories:
I have the same question (0)
  • Florian_Kleinz Profile Picture
    227 on at

    Hello,

     

    I think generally it would be easier to filter directly the data source of your first gallery, but since there are reasons for not doing so I propose the following:

    ClearCollect(mylist_;ForAll(Filter(Gallery6.AllItems;quantity>0);ThisRecord))

    Please let me know if this helps.

     

    Best regards

    Florian 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Florian_Kleinz 

    Hello, thank you for your help.

     

    I don't know why but not working,😅

     

    pain.png

     

  • slhangen Profile Picture
    356 on at

    Not sure if it helps but record is misspelled. 

  • Verified answer
    dyee4614 Profile Picture
    283 on at

    I think this is the easiest way to do it.

     

    1) Use Clear Collect instead of clearing it each time

    2) Don't bother with ForAll, just use filter.  

    3) Use ShowColumns to drop the other columns

     

    It will look something like this

     

    ClearCollect(MyList_,ShowColumn(Filter(Gallery6,Qty>=0),column1,column2,column3)

  • Florian_Kleinz Profile Picture
    227 on at

    Hello if your txt_qty is a string as naming implies you need to wrap it with VALUE.

     

    ClearCollect(mylist_;ForAll(Filter(Gallery6.AllItems;VALUE(quantity)>0);ThisRecord))

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard