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 / "ForAll" with "If" and...
Power Apps
Unanswered

"ForAll" with "If" and "DisplayMode"

(0) ShareShare
ReportReport
Posted on by 51

Hey everyone, 

 

We are having trouble using a 'ForAll' with my If statement.  Here is what we have:

 

ForAll(Gallery3.AllItems,If(Checkbox1.Value=false And Checkbox2.Value=false,displaymode.disabled,Displaymode.edit))

 

We are getting an error stating the ForAll expects an enum value.  

Categories:
I have the same question (0)
  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    I don't understand what the Forall() is trying to do. It is looping through some records but it is just returning displaymode.disabled or Displaymode.edit, so based on the last record in the loop the final result will be displaymode.disabled or Displaymode.edit.

     

    Where is this formula being used and why do you need to loop through a gallery to get a display mode value?

  • ag12 Profile Picture
    51 on at

    Sorry that wan't explained very clearly.  Currently each gallery has two checkboxes per row.  As an app user collects parts they select a checkbox in the gallery indicating whether or not they were able to collect the part.  Then there is a final submit button.  We want the final submit button to be hidden until a section is made for each gallery row. My understanding of the code was: For all rows in the gallery, check to see if a checkbox is marked and if all rows have a box marked, show the button.  

  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    Try this formula in the DisplayMode property of the Submit button.

     

    If(IsBlank(LookUp(Gallery3.AllItems, Checkbox1.Value=false And Checkbox2.Value=false).Checkbox1.Value), DisplayMode.Edit, DisplayMode.Disabled)

     

  • Battina Profile Picture
    3 on at

    Thank you so much !! You saved my day, your solution helped me a lot !!

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

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard