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 / URGENT - Lookup before...
Power Apps
Unanswered

URGENT - Lookup before patching

(0) ShareShare
ReportReport
Posted on by 802

Hi there, 

 

I really have to get this right as its for an urgent business case. 

 

I have a very basic Dataverse table which will be patched OnSelect of a button like below

 

Patch(DVTABLENAME, Defaults(DVTABLENAME),
{Name: User().FullName},
{Email: User().Email},
{'Office Location': Dropdown8.Selected.Value},
{'Date': DatePicker1.SelectedDate},
{'Redemption': "Unredeemed"});

 

But we need to ensure that a user can only make ONE reservation/patch per SelectedDate in the DatePicker control. If they try to click submit more than once, throw them an error message. 

 

How can I do this so that I look up the colleague's email address AND the chosen date on the Dataverse table and, only if a row does not exist currently with these two elements, allow the patch?

 

Many thanks

 

K. 

I have the same question (0)
  • meelamri Profile Picture
    468 on at

    Hello @Kosenurm , 

     

    I think you can do a server side validation. This will send the error message back to your application.

    At first sight, I would consider a validation using a plugin that will run in pre-validation.

     

    Please tick Accept as solution if the answer is useful.

    https://xrmtricks.com/

  • Kosenurm Profile Picture
    802 on at

    Thanks, I need really just a simple lookup though as a quick and dirty solution - so that an error message displays if they already have a record in the table with the chosen date and email. 

     

    Any ideas?

     

    Thanks

    K.

  • meelamri Profile Picture
    468 on at

    So maybe you can make the a validation when users change the values and display the submit button only if the values is correct.

  • AhmedSalih Profile Picture
    6,678 Moderator on at

    Hello, @Kosenurm, Add a Label with your desired error Message wherever you want the error message to appear. Then, in the error message Label Visible Property add theis formula: 

    If(!IsBlank(LookUp(DVTABLENAME, 'Date'=DatePicker1.SelectedDate && Email=User().Email,'Date')),true,false)

     


    If my reply helped you, please give a 👍, & if it solved your issue, please 👍 & Accept it as the Solution to help other community members find it more.


    I am primarily available on weekdays from 6-10 PM CT and 5-10 PM CT on weekends.


    Visit my Blog: www.powerplatformplace.com

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 93 Most Valuable Professional

#2
Haque Profile Picture

Haque 81

#3
Valantis Profile Picture

Valantis 49

Last 30 days Overall leaderboard