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 / Looking if a collectio...
Power Apps
Unanswered

Looking if a collection is inside of a column and filter on that

(0) ShareShare
ReportReport
Posted on by 302

I have a collection of products that I put in a gallery, that looks like this;

efeewfew_1-1634987434904.png

efeewfew_2-1634987527436.png

I added a label in the gallery named lblProduct

 

That collection is basically an array of products. Now I need to filter a gallery based on those values in that collection.

 

I am currently doing it like this, but it only takes the first product, and not the other products. I want to filter Checklist_Vragen_OpleverApp based on the values in the collection

Filter(Checklist_Vragen_OpleverApp; lblProduct.Text in Product_Type)

 

Categories:
I have the same question (0)
  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @efeewfew ,

    Well didn't quite get entire detail but I've created something similar which might help you.

    I assume you want to filter all record based on the product type.

    Ethan_R_0-1634995435075.png

    //I created 2 collection. 1 collection has products to find.
    // 2nd collection is list of all products
    
    ClearCollect(
     colProducts,
     {
     'Product Name': "Stalen Hek" 
     },
     {
     'Product Name': "Baluster"
     }
    );
    
    ClearCollect(
     colListProducts,
     {
     Name: "Product A",
     Type: "Stalen Hek"
     },
     {
     Name: "Product B",
     Type: "Stalen Hek"
     },
     {
     Name: "Product C",
     Type: "Baluster"
     },
     {
     Name: "Product D",
     Type: "Baluster"
     },
     {
     Name: "Product M",
     Type: "BlueHill"
     },
     {
     Name: "Product N",
     Type: "BlueHill"
     }
    );

    Now I filtered 2 products from all product list.

    Ungroup(ForAll(colProducts,
     Filter(
     colListProducts,
     'Product Name' in Type
     )
    ),"Value")

    This is the Output

    Ethan_R_1-1634995547430.png

     

     

    Hope this helps

  • efeewfew Profile Picture
    302 on at

    Hey @Ethan_R 

    Thank you for your reply and sorry for my late response!

    I've been trying to replicate how you made it but I've ran into some issues.

    The database for all products with their questions (in your test, this is the collection with all the producttypes & names

    efeewfew_0-1636185014627.png

    I then have a column where I have all of the products that I need to get the questions from;
    (This is your colProducts)

    efeewfew_1-1636185127336.png
    I am splitting this column to turn it into a collection;

     

    ClearCollect(
     collectieProducten; 
     Split(varProducten; ",")
    );;

     

    I split the values on "," and put them in a collection, result:

    efeewfew_2-1636185450562.png

    efeewfew_3-1636185607535.png

     

    Now we need to check if these values are in the database;    Checklist_Vragen_Opties (the database with the questions & products)
    I tried to do it how you had it, but it shows some questions more than one time & the product name is the same for every label;

     

    Ungroup(
     ForAll(collectieProducten;
     Filter(
     Checklist_Vragen_OpleverApp;
     Product_Type in collectieProducten
     )
     ); 
    "Value")

     

     

    efeewfew_4-1636185709380.png
    I was expecting 6 questions, but I get 9. And the product names are all the same and don't have their actual product name

     

    What am I doing wrong / do I have to add/change?

    Thank you in advance! @Ethan_R 

  • efeewfew Profile Picture
    302 on at

    Even if I filter it only on "Baluster", I'd expect to get 2 rows of questions, but I get 6 questions instead.. So weird

    efeewfew_0-1636186288548.png


    If I do it like this, I do get the expected result;

    efeewfew_1-1636187259270.png

     

  • efeewfew Profile Picture
    302 on at

    Anyone able to help me out? 

    @Ethan_R  you maybe? 🙂

  • efeewfew Profile Picture
    302 on at

    In your ungroup function, I get the error that I can't use a table in there @Ethan_R 

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard