cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
hiti
Helper II
Helper II

Error message in power apps

Hi,

 

I would like to add an error message when wrong input is given in any field. In which property I should enter this message.

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @hiti :

Thanks for @ChrisPiasecki 's suggestion.I want to use a few sentences to summarize what I want to add.

1\To achieve this function, two steps are required: verification and error reporting

2\To verify that the user's input is correct, you can set the OnChange property of this control. (When the user input is completed, the OnChange property will be triggered)

3\To pop up an error message, the easiest way is to use Notify function in Power Apps  function.

I've made a test for your reference:

I assume that if the user enters characters other than numbers, the application will report an error:

Set the text input control's OnChang Property to:

 

If(!IsMatch(Self.Text,"\d*"),Notify("You can only enter numbers!"))

 

12.gif

Best Regards,

Bof

View solution in original post

2 REPLIES 2
ChrisPiasecki
Super User
Super User

Hi @hiti,

 

The below guide does a good job showing how you can validate a field when it leaves focus (OnChange)

 

https://matthewdevaney.com/data-validation-for-power-apps-forms/

 

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

v-bofeng-msft
Community Support
Community Support

Hi @hiti :

Thanks for @ChrisPiasecki 's suggestion.I want to use a few sentences to summarize what I want to add.

1\To achieve this function, two steps are required: verification and error reporting

2\To verify that the user's input is correct, you can set the OnChange property of this control. (When the user input is completed, the OnChange property will be triggered)

3\To pop up an error message, the easiest way is to use Notify function in Power Apps  function.

I've made a test for your reference:

I assume that if the user enters characters other than numbers, the application will report an error:

Set the text input control's OnChang Property to:

 

If(!IsMatch(Self.Text,"\d*"),Notify("You can only enter numbers!"))

 

12.gif

Best Regards,

Bof

View solution in original post

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,433)