cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Mitigating Database Errors

I am trying mitigating database errors; catch them before they occur. For example, it a SubmitForm is going to fail because of a duplicate key, I would like to be able to catch it and display an error message.

 

Thanks in advance...

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Mitigating Database Errors

Hi @Bobby_Wallace,

 

We could avoid some errors before they happen by using the Validate and DataSourceInfo functions. The Validate function checks whether the value of a single column or a complete record is valid for a data source, while DataSourceInfo provides information about a data source.

 

About your scenario of checking a duplicate key, please check if the following way will work for you.

Create an app that is based on SharePoint list B.

On the EditForm screen, within the Title card, under the Title label, add another label and set its Text property with the following code:

If(IsEmpty(Filter(ListB,DataCardValue9.Text in Title))=false,"conflict","")

Then when you enter an item that already exists, error message conflict will be displayed, otherwise, it will be blank.

1.PNG

Hope it could be your reference.

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Mitigating Database Errors

Hi @Bobby_Wallace,

 

We could avoid some errors before they happen by using the Validate and DataSourceInfo functions. The Validate function checks whether the value of a single column or a complete record is valid for a data source, while DataSourceInfo provides information about a data source.

 

About your scenario of checking a duplicate key, please check if the following way will work for you.

Create an app that is based on SharePoint list B.

On the EditForm screen, within the Title card, under the Title label, add another label and set its Text property with the following code:

If(IsEmpty(Filter(ListB,DataCardValue9.Text in Title))=false,"conflict","")

Then when you enter an item that already exists, error message conflict will be displayed, otherwise, it will be blank.

1.PNG

Hope it could be your reference.

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,366)