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

Validate or show a message in label, if field is empty

I have a dialogbox in Powerapp, where approver has to key-in the reason for not approving the request. This field is a multiple lines of text and not mandatory in SharePoint, because only if the request is not approved, the below dialog appears and reason has to be keyed-in.

 

Since its not a mandatory field, I have written below validation in Proceed OnSelect to check if its empty or not. Still, I am able to submit the record and there's no notification message as stated in the code below

 

If(IsEmpty(DialogComments.Text),Notify("Please enter the reason",NotificationType.Error),SubmitForm(NewForm_2));

 

Scr.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User
Dual Super User

Re: Validate or show a message in label, if field is empty

Hi @Kumar9024021 

 

IsEmpty function is used to check if a list is empty. If you want to check if a text input is empty, you need to use the IsBlank() function.

Can you try to update your expression to:

If(IsBlank(DialogComments.Text),Notify("Please enter the reason",NotificationType.Error),SubmitForm(NewForm_2));

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

2 REPLIES 2

Re: Validate or show a message in label, if field is empty

The key is to make the button disabled until the comments have been added since PowerApps does not have the nice feature to make something required.   You can also add an icon for the asterik and color it red, and make it visible/not visible based on your validation.

 

Use the 'Visible' attribute to control the visibility of the asterisk icon and your button.   

 

This is the visible statement for the asterisk icon.  If(IsBlank(tiCity), true)

 

This is the visible statement for my 'Next' icon.  If(IsBlank(ddEmployeeStatus) Or ddEmployeeStatus.Selected.ActualValue = "temp" And (IsBlank(dpStartDate) Or IsBlank(dpEndDate)), false, true)

 

 

requiredfield.png                 requiredfield1.png

 

 

Highlighted
Dual Super User
Dual Super User

Re: Validate or show a message in label, if field is empty

Hi @Kumar9024021 

 

IsEmpty function is used to check if a list is empty. If you want to check if a text input is empty, you need to use the IsBlank() function.

Can you try to update your expression to:

If(IsBlank(DialogComments.Text),Notify("Please enter the reason",NotificationType.Error),SubmitForm(NewForm_2));

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

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.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

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,328)