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 / Checking If a Date Exists
Power Apps
Unanswered

Checking If a Date Exists

(0) ShareShare
ReportReport
Posted on by

Good Morning All,

 

For background: I have a SharePoint list that is updated by users once a week through a form I have created in Power Apps. If User A has already added numbers to a particular column in the list for today, then that input box is now only editable by User A. If nobody has made any inputs today, there will not be any items or records with today's date in it.

 

So, I have a column in the SP list called--(hold on to your hats)--Date.

 

How can I check if there is a record with today's date in the Date column? 

 

If I do a line like this:

 

If(LookUp(Accomplishments, IsToday(Date) and User_Name = LabelCurrentUser, User_Name)<> LabelCurrentUser.Text, DisplayMode.Edit,DisplayMode.View)

 

If today's date is not in the SP list, it defaults to a fail. I need an If statement that checks if there are any records with today's date in the Date column.

Frank D. Puthuff
Dell Technology

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Anonymous 

    You can determine this with:

    With(_items: Fiter(Accomplishments, User_Name = LabelCurrentUser.Text)},
     If(LookUp(_items, !IsBlank(Date), true),
     Edit,
     View
     )
    )

     

    I hope this is helpful for you.

  • Community Power Platform Member Profile Picture
    on at

    I basically need something that asks:

    Is there a record with today's date?

    or

    Does today's date exist in the date column?

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Anonymous 

    There is some logic missing in what you are saying...

     

    In your formula you are relating records to the user.  How does that factor into what you are now saying?

     

    Is there a record with today's date? for the current user??

    or

    Does today's date exist in the date column? for the current user??

     

    Not clear on where that fits in.

  • Community Power Platform Member Profile Picture
    on at

    Disregard current_user.

     

    Does the today's date exist in the Date column.

     

    I re-looked at my initial post and see that I asked this question, "How can I check if there is a record with today's date in the Date column?" 😉 With that one piece of knowledge, I should be able to build the rest of my logic.

  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Anonymous 

    Yes, so then just modify the formula to remove the user check:

    If(LookUp(Accomplishments, IsToday(Date), true),
     Edit,
     View
    )

    That should check to see if there is any record with today's date in it.

  • Community Power Platform Member Profile Picture
    on at

    We're getting close. If I were to change the true to a false, like so:

    If(LookUp(Accomplishments, IsToday(Date), false),
     Edit,
     View
    )

    Would it do the Edit if there were no records with today's date?

  • Community Power Platform Member Profile Picture
    on at

    I am going to call this a solution. You got me close enough, and with a little testing, I got it working like I needed.

    I can't figure out how you create that blue box to write code in, but here is the code that is working for me on one of my rows.

     

    If(LookUp(Accomplishments, IsToday(Date), false), DisplayMode.View, If(LookUp(Accomplishments, IsToday(Date) And (GSEP_CHG_Storage_Complete > 0 Or GSEP_CHG_Storage_Failed > 0), User_Name <> LabelCurrentUser.Text), DisplayMode.View, DisplayMode.Edit))

     

    Thank you @RandyHayes 

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 759 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 310 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 228

Last 30 days Overall leaderboard