cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

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