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 / Multiple If Controls B...
Power Apps
Answered

Multiple If Controls Button DisplayMode

(0) ShareShare
ReportReport
Posted on by 5,331 Moderator

Can't get the following to work.

What am I missing?

Goal:
If TextInput is blank button is Disabled else Edit
Or
Is Checkbox value is false AND there is no attachment button Disabled else Edit

If(IsBlank(DataCardValue19_9.Text),DisplayMode.Disabled,DisplayMode.Edit,
If(RequestEditFormMinutesAttachedCheckbox.Value=false || CountRows(RequestEditFormViewAttachment_DataCardValue.Attachments) < 1 ,DisplayMode.Disabled, DisplayMode.Edit)
Phineas_0-1702665997877.png

 

Categories:
I have the same question (0)
  • ANB Profile Picture
    7,250 Super User 2026 Season 1 on at

    Hi @Phineas , Try this

     

    If(
     Or(
     IsBlank(DataCardValue19_9.Text),
     RequestEditFormMinutesAttachedCheckbox.Value=false,
     CountRows(RequestEditFormViewAttachment_DataCardValue.Attachments) < 1
     ), 
     DisplayMode.Disabled,
     DisplayMode.Edit
    )

     

    -----------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution ✅ if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍

    Thanks,
    ANB


  • Phineas Profile Picture
    5,331 Moderator on at

    Your formula worked is all three were true.

    The TextInput should stand alone.
         If TextInput is blank 'Disabled' else 'Edit'

    The Checkbox and Attachment control should work together -
         Checkbox true and attachment empty 'Disabled'
         Attachment added and Checkbox false 'Disabled'
         Checkbox true and attachment added 'Edit' else 'Disabled'

  • ANB Profile Picture
    7,250 Super User 2026 Season 1 on at

    @Phineas Try this:

    If(
     IsBlank(DataCardValue19_9.Text), DisplayMode.Disabled,
     And(RequestEditFormMinutesAttachedCheckbox.Value, CountRows(RequestEditFormViewAttachment_DataCardValue.Attachments) = 0), DisplayMode.Disabled,
     And(!RequestEditFormMinutesAttachedCheckbox.Value, CountRows(RequestEditFormViewAttachment_DataCardValue.Attachments) > 0), DisplayMode.Disabled,
     DisplayMode.Edit
    )

    -----------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution ✅ if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍

    Thanks,
    ANB


  • Phineas Profile Picture
    5,331 Moderator on at

    I wrote it just as you wrote it.

    Getting the error - Unexpected character. The formula contains 'Eof' where ParenClose is expected.

    I also noticed there is no 'value' for the checkbox values. Doesn't the formula have to have a 'true' or 'false' in those spots?

    If(
    IsBlank(DataCardValue19_9.Text),DisplayMode.Disabled,
    And(RequestEditFormMinutesAttachedCheckbox.Value, CountRows(RequestEditFormViewAttachment_DataCardValue.Attachments) =0
    ,DisplayMode.Disabled,
    And(!RequestEditFormMinutesAttachedCheckbox.Value, CountRows(RequestEditFormViewAttachment_DataCardValue.Attachments) >0
    ,DisplayMode.Disabled,DisplayMode.Edit))

    Phineas_0-1702671078435.png

     

  • Phineas Profile Picture
    5,331 Moderator on at

    Edited Reply -

    Finally got it.

    If(IsBlank(DataCard19_9.Text),
    If(RequestEditFormMinutesAttachedCheckbox.Value=false,DisplayMode.Disabled,
       CountRows(RequestEditFormViewAttachment_DataCardValue.Attachments) < 1,
       DisplayMode.Disabled,DisplayMode.Edit))

  • Verified answer
    ANB Profile Picture
    7,250 Super User 2026 Season 1 on at

    @Phineas You missed the closing brackets and added the extra bracket at end.

    ANB_1-1702697947470.png

     

    This is what I gave:

    ANB_0-1702697746325.png

    Please compare the code that I gave and the one you wrote. Always verify your code twice. These small and basic thing matters.

     

    Also, RequestEditFormMinutesAttachedCheckbox.Value is equivalent to RequestEditFormMinutesAttachedCheckbox.Value = true


    !RequestEditFormMinutesAttachedCheckbox.Value is equivalent to RequestEditFormMinutesAttachedCheckbox.Value = false

     

    If you simply copy past code that would have worked for you.

     

    Thanks,

    ANB

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

#2
Haque Profile Picture

Haque 230

#3
Kalathiya Profile Picture

Kalathiya 217 Super User 2026 Season 1

Last 30 days Overall leaderboard