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 / Check if all items in ...
Power Apps
Answered

Check if all items in a gallery /collection has a specific value/text

(0) ShareShare
ReportReport
Posted on by 321

Hi, 

like a write in the title, i have a gallery where i select some items and import them into a collection.

I have to see if the value "Approved" is in all the items i select.

I tried and tried but with no results.

Do you have any suggestions or require more info?

Thanks!

Categories:
I have the same question (0)
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    When you select hte item in the gallery, do this:

     

    If(ThisItem.Approved = true,

    //CREATE THE ITEM IN THE COLLECTION

    ,

    Notify("Item is not approved",Error)

    )

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,

    Gonçalo Nogueira

    Check my LinkedIn!

    Buy me a coffee!

    Check my User Group (pt-PT)!

    Last Post on Community

    My website!

  • Masino Profile Picture
    321 on at

    so, i have this gallery where i select items and then load into a collection or a new gallery(gallery2). I need to check if all the selected items has the " Approved" status, so i was doing like:

    If( gallery2.allitems.status = "Approved";" Approved";"Check Again")

    But apparently i cannot compare the value with a text, so here is my problem...

     

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    Status is a boolean, right?

     

    If( gallery.allitems.status = true;" Approved";"Check Again")

     

  • Masino Profile Picture
    321 on at

    Actually status is a choice(table).. i have 3 choices: Approved, Pending, Rejected

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    If( gallery.allitems.status.value = "Approved";"Approved";"Check Again")

  • Masino Profile Picture
    321 on at

    It says that i cant compare Table and text..and actually the .value is not selectable..so thats crazy..i m trying now to make a new column direct in the original sharepoint list where if([Status]="Approved";"Approved";"Check again")..but also here nothing

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    Use the ForAll function:

     

    https://www.spguides.com/powerapps-forall-function/

     

    Gor all the values, check if the value is "Approved" and if yes, create the item in the collection and if not, say that it has an error

  • Masino Profile Picture
    321 on at

    If(ForAll(Gallery_colistest.AllItems.Status;"Approved").Value="Approved";"Approved";"Try Again")

     

    nothing happens, i got back to the first error, can't compare table and boolean value.But thanks for trying help 😃

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    I am still trying to understand what you are trying to do.. You trying to create itens in a collection from a gallery, right?

    If yes, write this on a button: 


    ForAll(Gallery_colistest.AllItems;

    If(Status.Value="Approved",

    Collect(...),

    Notify("Item " & ID & " is not approved", Error)

    )

    )

     

    Otherwise, I do not understand what you want to do.

     

    I tryed that and it worked:

    Nogueira1306_0-1648468541938.png

     

  • Masino Profile Picture
    321 on at

    I ll try explain better, 

    I have a gallery and i load the items that are selected into a collection. Those items can be approved or not,doesnt matter now. Then in a new screen i load multiple times the same collection ( trying to make a nice looking layout)  so i have a nice page that can be printed with print(). 
    Down at the bottom there is a label that, if all the items that has been loaded has the "Approved" status, so it will say "Approved".

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

#2
11manish Profile Picture

11manish 191 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 122 Super User 2026 Season 2

Last 30 days Overall leaderboard