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 / Compare Gallery Allite...
Power Apps
Answered

Compare Gallery Allitems only last record

(0) ShareShare
ReportReport
Posted on by 259

Hi Guys,

 

So I have a gallery on my app that works like a CheckOut of online store.

Before it navigates to the next screen I want to validate if there are no materials with the 0 quantity selected.

 

vdfdf.PNG

The quantity field (red rectangle) is an input field, txtQtd.

 

ForAll(Gallery12_1.AllItems;
If(txtQtd.Text = "0";
 Notify("There are materials with quantity 0";NotificationType.Error);
 Notify("Ok";NotificationType.Success)))

 

Problem is, it only works with the last "record". In this case (image above) it´s returning OK, despite there is a material with quantity 0 (the middle one).

 

Categories:
I have the same question (0)
  • Verified answer
    BCBuizer Profile Picture
    22,833 Super User 2026 Season 1 on at

    Hi @JoaoSantos489 ,

     

    Another method is to use a filter to see if there are any items that match the condition and set actions accordingly:

    If(
     !IsEmpty(
    		Filter(
    			Gallery12_1.AllItems;
    			txtQtd.Text = "0"
    		)
    	);
    	Notify("There are materials with quantity 0";NotificationType.Error);
     Notify("Ok";NotificationType.Success)
    )

     

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

#2
11manish Profile Picture

11manish 193

#3
Valantis Profile Picture

Valantis 138

Last 30 days Overall leaderboard