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

Notifications

Announcements

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

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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard