cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DuncanIVH
Advocate I
Advocate I

IsEmpty and Isblank not disabling button

I have the following set on the DisplayMode of my button:

 

If(
IsBlank(TextIncidentName.Text) && (IsEmpty(ComboBoxIncidentCategories.SelectedItems) || IsBlank(ComboBoxIncidentCategories.Selected.Name)), DisplayMode.Disabled, DisplayMode.Edit

)

 

However as soon as the textbox TextIncidentName is populated, the button is enabled.

Even when IsEmpty or IsBlank evaluate to true for the Combobox, the button is enabled.

 

The brackets in bold are intended to group the OR but I'm not sure I've done this correctly.

 

Untitled.png

2 REPLIES 2
Expiscornovus
Super User
Super User

Hi @DuncanIVH,

 

If you want to change the displaymode on either TextIncidentName being empty or Selected Items being empty I would use an OR (||) instead of an AND (&&)

 

Can you try this instead:

If(IsBlank(TextIncidentName.Text) || IsEmpty(ComboBoxIncidentCategories.SelectedItems.Name), DisplayMode.Disabled, DisplayMode.Edit)

 

selecteditemsname.png



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


TheRobRush
Super User
Super User

Yet another way to write it would be (Assuming you just want the button enabled only when both an item is selected and text has been entered.

 

If(Or(IsEmpty(ComboBoxIncidentCategories.SelectedItems),IsBlank(TextIncidentName.Text)),DisplayMode.Disabled,DisplayMode.Edit)
_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,509)