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 Apps
Suggested Answer

Button DisplayMode

(2) ShareShare
ReportReport
Posted on by 114
Hi All,
 
trying to disable the button. Trouble is with the For All, because I need to check every single item in a gallery and its dropdown text that it is not empty (says expected boolean, number, decimal, text, dynamic). It works without the For All thing. Thanks for help.
 
 
 
If(
    IsEmpty(
        colVyber
        ) Or
    IsBlank(
        Value(
            datPlan.SelectedDate)
        ) Or
    ForAll(galPlanDelnik.AllItems As stred;
        IsBlank(
            stred.drpTextP.Text
        )
    );
    DisplayMode.Disabled;
    DisplayMode.Edit
)
Categories:
I have the same question (0)
  • Suggested answer
    Haque Profile Picture
    849 on at
    Hi @JM-14081323-0,
    ForAll(galPlanDelnik.AllItems As stred;
        IsBlank(stred.drpTextP.Text)
    )
    
    From this above code we are basically getting a table of true/false values — not one Boolean. That’s why the formula engine complains. Reference is here.
     
    We can go for CountIf -  counts how many items in the gallery have a blank items. If that count is greater than 0, disable the button.
    If(
        IsEmpty(colVyber) ||
        IsBlank(Value(datPlan.SelectedDate)) ||
        CountIf(galPlanDelnik.AllItems, IsBlank(drpTextP.Text)) > 0,
        DisplayMode.Disabled,
        DisplayMode.Edit
    )
    
    One more option is Filter - we retrieve only the items with blank dropdowns. If that filtered set is not empty, disable the button.
     
    If(
        IsEmpty(colVyber) ||
        IsBlank(Value(datPlan.SelectedDate)) ||
        !IsEmpty(Filter(galPlanDelnik.AllItems, IsBlank(drpTextP.Text))),
        DisplayMode.Disabled,
        DisplayMode.Edit
    )
    
    Please let me know if this works for you.
     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!
  • Suggested answer
    DP_Prabh Profile Picture
    293 on at
    In case of ForAll it didn't work because it returns a table not a Boolean value (true/false).
     
    If you want to check whether in dropdown any choice is selected, then show the submit btn or else don't. You may use the CountIf functions. I've tested same scenario at my end. Here are my findings:
    Replace ForAll with CountIf function
     
    If dropdown is having any value, it submits button will be visible or else it will be disabled.
    Code: Button -----DisplayMode property:
    If(
        IsEmpty(colTest) ||
        IsBlank(drpTest.Selected.Value) ||
        CountIf(
            Gallery1.AllItems,
            Coalesce(drpTest.Selected.Value, "") = ""
        ) > 0,
        DisplayMode.Disabled,
        DisplayMode.Edit
    )
     
    I hope this works for you!
  • Suggested answer
    11manish Profile Picture
    395 on at
    Why your formula fails

    ForAll(galPlanDelnik.AllItems As stred;
        IsBlank(stred.drpTextP.Text)
    )
    ForAll() returns a table, not a single true/false value
     
    But If() needs:
    • Boolean (true/false)
    Hence the error:
    • Expected Boolean, number, decimal, text…
    Best solution
    You want:
    • “Disable button if ANY dropdown is blank”
    Use CountIf() instead:
     
    If(
        IsEmpty(colVyber) ||
        IsBlank(datPlan.SelectedDate) ||
        CountIf(galPlanDelnik.AllItems, IsBlank(drpTextP.Text)) > 0,
        DisplayMode.Disabled,
        DisplayMode.Edit
    )

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 509 Most Valuable Professional

#2
Haque Profile Picture

Haque 302

#3
11manish Profile Picture

11manish 265

Last 30 days Overall leaderboard