Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

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!!! 

 

  • mmollet Profile Picture
    3,187 on at
    Re: Check Data in Dataverse table and return a notification

    No you! 😋

  • CU30071822-0 Profile Picture
    on at
    Re: Check Data in Dataverse table and return a notification

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

  • Verified answer
    mmollet Profile Picture
    3,187 on at
    Re: Check Data in Dataverse table and return a notification

    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
    Re: Check Data in Dataverse table and return a notification

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

     

    jubae22_0-1684354689590.png

     

  • mmollet Profile Picture
    3,187 on at
    Re: Check Data in Dataverse table and return a notification

    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
    Re: Check Data in Dataverse table and return a notification

    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
    Re: Check Data in Dataverse table and return a notification

    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
    Re: Check Data in Dataverse table and return a notification

    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
    Re: Check Data in Dataverse table and return a notification

    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])

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,605 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,946 Most Valuable Professional

Leaderboard