cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
joef
Level 8

Display the correct error

Hi All,

I have a unique column in my SPO list.  I created a PA for the list. 

DepositSlip is the unique column in SPO.  When I enter a duplicate deposit slip in PA, I get an error saying "There was a problem saving your changes.  The Data source may be invalid." 

Is there a way to produce an error message that is meaningful or at least set focus back the erroring field?

 

Thanks,

Joe

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Display the correct error

Hi,

 

Yes and No 🙂

 

You are aware of the need for this unique value, so why not have your App Generate it?

If you're not able to (for whatever reason, maybe process maybe values dont follow specific order etc), then you could do a catch of that error by checking for it before the Submit function is called.

 

So something like having this on your button instead of just Submit():
If(
   IsBlank(
               LookUp(DataSource, DepositSlipColumnName = DepositSlipValueInApp.Text).DepositSlipColumnName
   ),
   // If its blank then there's no existing value with that same value so submit

   SubmitForm(NameOfForm)
   ,
   // If its not blank then let the user know and switch focus to that field
   Notify("Please use a Unique value for your deposit slip", NotificationType.Warning);
   SetFocus(DepositSlipValueInApp)
)

 

So what we are doing there is checking if there's any rows with the DepositSlipValue that has been typed in the datasource, before we even consider submitting, then notifying andshifting focus if we do find an existing value.

 

Hope this has been helpful, let us know if you run into any other issues with it,

 

Cheers,

ManCat




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!

View solution in original post

1 REPLY 1
Highlighted
Super User
Super User

Re: Display the correct error

Hi,

 

Yes and No 🙂

 

You are aware of the need for this unique value, so why not have your App Generate it?

If you're not able to (for whatever reason, maybe process maybe values dont follow specific order etc), then you could do a catch of that error by checking for it before the Submit function is called.

 

So something like having this on your button instead of just Submit():
If(
   IsBlank(
               LookUp(DataSource, DepositSlipColumnName = DepositSlipValueInApp.Text).DepositSlipColumnName
   ),
   // If its blank then there's no existing value with that same value so submit

   SubmitForm(NameOfForm)
   ,
   // If its not blank then let the user know and switch focus to that field
   Notify("Please use a Unique value for your deposit slip", NotificationType.Warning);
   SetFocus(DepositSlipValueInApp)
)

 

So what we are doing there is checking if there's any rows with the DepositSlipValue that has been typed in the datasource, before we even consider submitting, then notifying andshifting focus if we do find an existing value.

 

Hope this has been helpful, let us know if you run into any other issues with it,

 

Cheers,

ManCat




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,110)