web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / return custom error if...
Power Apps
Answered

return custom error if matching record not found in Sharepoint list

(0) ShareShare
ReportReport
Posted on by 53

Hi

 

I have a sharepoint list which contains the ID field and an email field. I want to search the sharepoint list for the ID and check that the email address matches before writing back todays date and time into another field. 

 

this is what I have so far:

Patch('MySharePointList', LookUp('MySharePointList', ID = txt_SignOutID.Text And 'Email Address' = txt_SignOUTEmail.Text & MatchOptions.IgnoreCase),{'EXIT Date and Time': Now()});

Navigate(SplashScreen,ScreenTransition.Fade)

 

I want to notify the app user if the ID and email do not match and allow them to try again rather than navigating back to the splashscreen. Could someone help with how I can do this? @WarrenBelz maybe?

 

thanks in advance 🙂

Categories:
I have the same question (0)
  • turnerj3 Profile Picture
    2,039 on at

    @loha ,

    You could use an If(!IsBlank() to make sure a record exists on your lookup. (! Works as not)

    If(!IsBlank(LookUp('MySharePointList', ID = txt_SignOutID.Text And 'Email Address' = txt_SignOUTEmail.Text & MatchOptions.IgnoreCase)),

    Patch('MySharePointList', LookUp('MySharePointList', ID = txt_SignOutID.Text And 'Email Address' = txt_SignOUTEmail.Text & MatchOptions.IgnoreCase),{'EXIT Date and Time': Now()}) And

    Navigate(SplashScreen,ScreenTransition.Fade))

     

  • loha Profile Picture
    53 on at

    Thank you for your reply! I have tried to implement this and I'm getting an invalid argument type error on the Patch:

    loha_1-1685438931864.png

     

     

     

  • loha Profile Picture
    53 on at

    Got rid of the error, but now it doesn't update the SP List with the current date and time when the ID and email matches:

    loha_0-1685441795279.png

     

  • Verified answer
    turnerj3 Profile Picture
    2,039 on at

    @loha ,

    Try putting this notify in place of your patch and lets make sure we are getting a record.

    Notify("success")

  • loha Profile Picture
    53 on at

    Thank you - this notify helped me troubleshoot the code! So when i put the notify code in place of the patch, it didn't return anything. I tried removing the matchcase.ignore and its working now! I've no idea why, but I'll play around with the matchcase as I need it. 

     

    thanks for all your help, it's very much appreciated 🙂

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 413

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
timl Profile Picture

timl 315 Super User 2026 Season 1

Last 30 days Overall leaderboard