cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Disable button until textinput box is populated

MarkUTP_0-1602254368635.png

So i have this form above that has a peoplepicker Combobox that will populate the textinput boxes with its selected Displayname and Email. The Change Lead 1 button will send a notification email to the person selected and patch a sharepoint list

 

I notice that if the user accidentally clicks the button with the textinput boxes being empty, the app itself will encounter an error.

 

any tips on how i can do that kind of check to ensure that the Change Lead 1 button can only be used if textinput box is populated?

 

 

Here is the code of the Change Lead 1 button if it might help:

 

 


Office365Outlook.SendEmailV2(
txtLead1Email.Text,
"BCM Test Notification: BCP Team Appointment for Account: " & txtAccountName_1.Text,
"Hi " & txtLead1Name.Text & "," &
"<br>" &
"<br>" & "You have been selected as BCP Lead 1 for: " & txtAccountName_1.Text & " by " & User().FullName &
"<br>" &
"<br>" & "You will be receiving further instructions and guidance shortly", {Cc: "user@user.com;" & User().Email}
);

Patch(
'ProgramLevelRoster',
LookUp(ProgramLevelRoster, Title = txtAccountName_1.Text ), {PrimaryLead: txtLead1Name.Text} // stores selected user to "PrimaryLead"
);

Patch(
'ProgramLevelRoster',
LookUp(ProgramLevelRoster, Title = txtAccountName_1.Text ), {PrimaryLeadEmail: txtLead1Email.Text} // stores selected user's email to "PrimaryLeadEmail"
);

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

@MarkUTP 

You can consider changing the DisplayMode property of the button to the following Formula:

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

I hope this is helpful for you. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

2 REPLIES 2
Highlighted
Super User III
Super User III

@MarkUTP 

You can consider changing the DisplayMode property of the button to the following Formula:

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

I hope this is helpful for you. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Highlighted

Hi Randy, it works like a charm. thank you so miuch.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (6,472)