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

Test validation prior to save

How do you test to see if there is a validation error prior to saving a record? What command do you use? I have a save button, that displays a message in a textbox to say the record is "Saved", but i want to make sure that there are no validation errors prior to displaying this message. Thanks for any help.

1 ACCEPTED SOLUTION

Accepted Solutions
hpkeong
Community Champion
Community Champion

Hi

 

https://powerapps.microsoft.com/en-us/tutorials/working-with-data-sources/

of Tutorial does have this section for Validation

 

Validation

Before making a change to a record, the app should do what it can to make sure the change will be acceptable. There are two reasons for this:

  • Immediate feedback to the user. The best time to fix a problem is right when it happens, when it is fresh in the user's mind. Literally with each touch or keystroke, red text can appear that identifies an issue with their entry.
  • Less network traffic and less user latency. More issues detected in the app means fewer conversations over the network to detect and resolve issues. Each conversation takes time during which the user must wait before they can move on.

PowerApps offers two tools for validation:

  • The data source can provide information about what is and isn't valid. For example, numbers can have minimum and maximum values, and one or more entries can be required. You can access this information with the DataSourceInfo function.
  • The Validate function uses this same information to check the value of a single column or of an entire record.

Hope this helps.

hpkeong

View solution in original post

3 REPLIES 3
hpkeong
Community Champion
Community Champion

Hi

 

https://powerapps.microsoft.com/en-us/tutorials/working-with-data-sources/

of Tutorial does have this section for Validation

 

Validation

Before making a change to a record, the app should do what it can to make sure the change will be acceptable. There are two reasons for this:

  • Immediate feedback to the user. The best time to fix a problem is right when it happens, when it is fresh in the user's mind. Literally with each touch or keystroke, red text can appear that identifies an issue with their entry.
  • Less network traffic and less user latency. More issues detected in the app means fewer conversations over the network to detect and resolve issues. Each conversation takes time during which the user must wait before they can move on.

PowerApps offers two tools for validation:

  • The data source can provide information about what is and isn't valid. For example, numbers can have minimum and maximum values, and one or more entries can be required. You can access this information with the DataSourceInfo function.
  • The Validate function uses this same information to check the value of a single column or of an entire record.

Hope this helps.

hpkeong

Yes, but i am creating a custom message when a record is saved, to let the user know the record is saved. By default a message is not displayed. My custom message will say saved regardless if there is an error, such as validation. I wanted to know if there is a function that can test too make sure there are no errors prior to my custom message being displayed. I don't want it to display a message if there is an error, only on no errors.

hpkeong
Community Champion
Community Champion

Hi

 

When you are writing your formula and tested your formula, nothing shall go wrong.

What is expected is only:

- When there is no connection

- When a textinput is not filled-in (if you use CDS, set Required = Yes)

- No repeat in Saving (set the AutoDisableOnSelect = True)

- Numerical & Text value (this can be set in CDS)

 

I am not sure what kind of validation prior to saving without error.

I might pretty poor in understanding your needs and hope others can try to help you.

 

TQ

hpkeong

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (2,753)