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 / Specific date out of S...
Power Apps
Answered

Specific date out of SharePoint

(0) ShareShare
ReportReport
Posted on by 17

Hi all,

 

I'm trying to pull a date value from a SharePoint list but am failing in my logic somewhere. I want to store this as a variable to leverage elsewhere in the application so I'm doing this in the OnVisible property.

 

List named Deadlines has 2 fields "Category" and "DateofEvent". I want to pull the next date after today where the event occurs and I think the sorting is tripping me up. Category is a choice field, DateofEvent is a date field. If I don't sort the query, the result is incorrect as it looks like SharePoint is giving it to Powerapps by date created, which isn't even in my query. 

 

Here's what I'm doing that pulls back a record, but it is by created date, not the DateofEvent field:

 

Set(varDeadlineDate,First(Filter(Deadlines, Category.Value="Application Deadline" And DateofEvent> DateValue(Now())).DateofEvent))

 

I've tried this with no success, it's coming back as a blank record:

Set(varDeadlineDate,First (Sort(Filter(Deadlines,Category.Value = "Application Deadline" And DateofEvent > DateValue(Now())).DateofEvent,DateofEvent,Ascending)))

 

Where am I going wrong? Also, if you've got suggestions on a better way to handle this, I welcome the input. Thank you!

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

    @bellm1en 

    Please consider changing your Formula to the following:

    Set(varDeadlineDate,
     LookUp(
     Sort(Deadlines, DateofEvent, Ascending),
     Category.Value="Application Deadline" && 
     DateofEvent > Today(),
     DateofEvent
     )
    )

     

    Keep in mind that even if you have a date only column, it will still have a time component and thus compare greater than Today() might still yield an incorrect result.

     

    But, try the above first.

     

    I hope this is helpful for you.

  • bellm1en Profile Picture
    17 on at

    Thank you for the reply. I've tried that but it comes back empty and I'm not sure why.

    bellm1en_0-1662669641920.png

     

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

    @bellm1en 

    Well, let's explore!!

    How many records are in your list?  And, what is the record limit set to in your app?

  • bellm1en Profile Picture
    17 on at

    Thank you - I have no idea why the app limit was set so low but I  *think* that fixed it. 

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

    @bellm1en 

    Very good!  The limit is 2000.  So, as long as you are not exceeding that limit, all should be good.

  • bellm1en Profile Picture
    17 on at

    Now I've encountered an interesting issue - it works, but ONLY for me. When another user attempts, even though the application and connections are shared with everyone, the variable is blank. I'm the only Owner of the app.

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

    @bellm1en 

    App ownership is not an issue.  What is, would be list permissions.  Do the users have permission to the list?

    Connections are not shared in the sense that how you configured them would be shared.  Each user utilizes a connection with their account...not the one that you use during design.

     

  • bellm1en Profile Picture
    17 on at

    Sure, that I get - it is just odd that this specific list has the same permissions as the rest of the lists in the site and isn't working. I just re-set permissions on the list and it appears to be working. Weird. Thanks again.

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

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 294 Most Valuable Professional

#2
11manish Profile Picture

11manish 210

#3
Valantis Profile Picture

Valantis 169

Last 30 days Overall leaderboard