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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Check Data in Datavers...
Power Apps
Unanswered

Check Data in Dataverse table and return a notification

(0) ShareShare
ReportReport
Posted on by

Good Morning, 

 

I am having trouble figuring out how to validate data in a table. 

 

I have built a timekeeping application.... The user has to select the week ending date for which they are entering their time.  When the person selects the week ending date on a date picker i want to verify if the user already has a timesheet for that week ending in a Dataverse table. If the user indeed has a timesheet already for that particular week i want to display a notification stating "A timesheet already exists for that week ending go to edit timesheet instead. 

 

Do i need to grab that data and put it in a collection ? Can it just verify by pointing to the actual table.... do i do a variable etc..... 

 

Thank you all in advance!!! 

 

Categories:
I have the same question (0)
  • mmollet Profile Picture
    3,187 on at

    Seems like you should be able to just do a lookup into your SP list. If you have an item with the same name/employeeID And the same ending date then you can be sure that an entry for that week for that person is already done. 

     

    If(IsBlank(LookUp(SPListName, employeeID = [empIDToSearch] And WeekEndsOn = DatePicker.SelectedDate, Notify("already made etc...", NotificationType.Error), [patch the users entry as a new row])

  • CU30071822-0 Profile Picture
    on at

    Thank you for your response!!!! 

     

    I am getting a few error messages. Please see images. 

     

    jubae22_1-1684348203647.png

    jubae22_2-1684348261876.png

     

    Also is this the correct way to nest two IF statements? 

     

    jubae22_3-1684348347549.png

     

     

     

     

     

  • mmollet Profile Picture
    3,187 on at

    First thing is when you are referencing your datepicker you are referencing the control not its value. Here is an example. If you have a control named Control and you type into a label Control it will get confused as the type of Control cannot be resolved into a number or text b/c it is an object. What you are wanting is that controls value that it is holding. In your case with a datepicker you will want to use BusinessDay_DatePicker.SelectedDate instead. Let me know what this does after the change! 🙂

  • CU30071822-0 Profile Picture
    on at

    Sorry i forgot to add the .SelectedDate as you first indicated.

     

    that seemed to fix the error but now I'm getting the following

     

    Not sure if I'm missing a few more parenthesis

     

    jubae22_0-1684352228322.png

     

  • mmollet Profile Picture
    3,187 on at

    Not 100% sure as the error popup is blocking the code a bit but that seems to be the case. Just make sure your lookup is closed after the 2nd condition where its hidden. If that is closed properly then you should check that the isblack call is closed properly next. 

     

    If you click near a parenthesis it will show you its 'partner' by highlighting both of them so you can have a little easier time tracking down what goes with what. 

     

    EDIT: based on your first response to me it seems like you need to add 2 closing parenthesis right after: BusinessDay_Datepicker.SelectedDate)), Notify(....

  • CU30071822-0 Profile Picture
    on at

    This is the updated code... with the error at the last parenthesis 

     

    jubae22_0-1684354689590.png

     

  • Verified answer
    mmollet Profile Picture
    3,187 on at

    based on your first response to me it seems like you need to add 2 closing parenthesis right after: BusinessDay_Datepicker.SelectedDate)), Notify(....

  • CU30071822-0 Profile Picture
    on at

    mmollet you are the man!!!!! It's working perfectly!!! Your time and responses is much appreciated. 

  • mmollet Profile Picture
    3,187 on at

    No you! 😋

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard