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!