cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
joef
Continued Contributor
Continued Contributor

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
iAm_ManCat
Super User
Super User

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

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

1 REPLY 1
iAm_ManCat
Super User
Super User

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

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,922)