cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
tjtaylor
Level: Powered On

Button Display Mode Not Changing

Hello!
 
I'm having a problem with my Submit button not disabling if a required datacard is not completed. Here's what I have: 
 
DisplayMode = If(IsBlank(Organization_DataCard7_1), Disabled, Edit)
 
I also tried:
DisplayMode = If(IsBlank(Organization_DataCard7_1.Text), Disabled, Edit).
When I add the ".Text" I get an error message that the name isn't valid and the identifier isn't recognized. 
 
What am I missing?
 
Thanks!
 
 
3 REPLIES 3
Super User
Super User

Re: Button Display Mode Not Changing

@tjtaylor 

My first guess is that you are not targeting the correct control.  I think the control you want would be something like DataCardValue1.Text which is inside of Organization_DataCard7_1.

 

Note: DataCardValue1 will have to be replaced with the correct name from your app.

If(IsBlank(DataCardValue1.Text), Disabled, Edit)

 

If you need further help can you please post a screenshot showing your workspace?  I want to see the left side menu and what the icon beside Organization_DataCard7_1's name looks like.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

tjtaylor
Level: Powered On

Re: Button Display Mode Not Changing

Worked perfect! If I have multiple required fields. would I do this:

 

If(IsBlank(DataCardValue76_1.Text) || (DataCardValue77_1.Selected.Value) || (DataCardValue91_1.Selected.Value) || (DataCardValue96_1.Selected.Value), Disabled, Edit)
 
Datacards 77, 91 and 96 are drop downs.
Super User
Super User

Re: Button Display Mode Not Changing

@tjtaylor 

You've got the right idea but you'll need to use IsBlank for each condition like this.

 

If(
    IsBlank(DataCardValue76_1.Text) 
    || IsBlank(DataCardValue77_1.Selected.Value) 
    || IsBlank(DataCardValue91_1.Selected.Value) 
    || IsBlank(DataCardValue96_1.Selected.Value),
    Disabled, 
    Edit
)

 

A commonly confused concept on the forum is combobox vs a dropdown.  They look very similar so many people are mistaken.  If you are using comboboxes this would be the code instead

 

If(
    IsBlank(DataCardValue76_1.Text) 
    || IsEmpty(DataCardValue77_1.Selected) 
    || IsEmpty(DataCardValue91_1.Selected) 
    || IsEmpty(DataCardValue96_1.Selected),
    Disabled, 
    Edit
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,326)