cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lucas_Ignatius
Helper V
Helper V

DisplayMode Button Disabled

How to make button disabled if two column is Blank, because I just add Formula still not working

 

If(IsBlank(TextInput1 & TextInput2),DisplayMode.Disabled,DisplayMode.Edit)

 

I need if TextInput2 ( TotalBudge) and TextInput1 (BudgetID) is blank or empty button Save can't click

 

Lucas_Ignatius_1-1621833003540.png

 

 

And I want to clear all Column like Dropdown, Company, Department, BudgetID and Total Budget, any idea to make short formula?

Because I just add Function 

 

Reset (Dropdown1); Reset (TextInput1); Reset( TextInput2) 

 

this only work for Text Input (BudgetID and TotalBudget), but DropDown it didn't work

 

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi @Lucas_Ignatius ,

It seems that you do not have a form from your screenshot, so you can set the Reset Property of each control to a Variable (call it varReset), then to this

UpdateContext({varReset,true});
UpdateContext({varReset,false});

Also you screen shot shows input in one of the Text boxes, so the button should be in Edit mode, which it is. Are you wanting both boxes to be completed for the button to go into Edit Mode? If so, replace the And && with Or ||.

@PaulD1 raises an interesting point om looking for a blank concatenation of two values, although I suspect you were missing the .Text to properly refer to the control value.

 

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.

 

 

 

View solution in original post

@Lucas_Ignatius ,

You need to set it to true and then false as per my post

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.

 

 

 

View solution in original post

8 REPLIES 8
WarrenBelz
Super User III
Super User III

Hi @Lucas_Ignatius ,

You need

If(
   IsBlank(TextInput1.Text) && IsBlank(TextInput2.Text),
   DisplayMode.Disabled,
   DisplayMode.Edit
)

for your fields, just reset the Form

Reset(YourFormName)

 

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.

PaulD1
Super User
Super User

@WarrenBelz - I would write it the same way you do:

IsBlank(TextInput1.Text) && IsBlank(TextInput2.Text)

However, logically I would expect

IsBlank(TextInput1 & TextInput2)

To return the same.

The default property should be Text (although I would not want to rely on that!) and Blank & Blank (concatenating two blanks) should yield Blank.

In my quick test the two give equivalent answers (with Formula Level Error connection set either way).

Interested to know (just for my own curiosity) if you have experience of IsBlank(TextInput1 & TextInput2) not working as expected and why that should be.

Hi @WarrenBelz 

 

I just tried it didn't work

Lucas_Ignatius_1-1621837131683.png

 

And about reset form, can you help me how I know my form name ?

 

Lucas_Ignatius_2-1621838753421.png

 

 

Hi @Lucas_Ignatius ,

It seems that you do not have a form from your screenshot, so you can set the Reset Property of each control to a Variable (call it varReset), then to this

UpdateContext({varReset,true});
UpdateContext({varReset,false});

Also you screen shot shows input in one of the Text boxes, so the button should be in Edit mode, which it is. Are you wanting both boxes to be completed for the button to go into Edit Mode? If so, replace the And && with Or ||.

@PaulD1 raises an interesting point om looking for a blank concatenation of two values, although I suspect you were missing the .Text to properly refer to the control value.

 

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.

 

 

 

View solution in original post

WarrenBelz
Super User III
Super User III

Hi @Lucas_Ignatius ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

Hi @WarrenBelz 

I'm still stuck for reset form, can you help me for more information with screenshoot.

Because, I just tried but still not working smoothly, I mean when I click button clear for first time it work but when I tried again it didn't work

 

My Formula is :

 

 

UpdateContext({varEditScreen1Reset:true})

 

 

Lucas_Ignatius_0-1622428844255.png

 

Lucas_Ignatius_1-1622429600389.png

 

 

@Lucas_Ignatius ,

You need to set it to true and then false as per my post

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.

 

 

 

View solution in original post

Hi, @WarrenBelz 

Yeah it works... It need 2 formula as you said, pardon me for my bad 😣
I hope you want to still help me for my next question.

dateContext({varEditScreen1Reset:true});
UpdateContext({varEditScreen1Reset:false})

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,118)