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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,977)