I have an event list in SP that I am trying to have filtered out for only 30 days out from todays date. Formula seems to check out but the results aren't getting filtered the way I'm expecting them to. I'm still getting results from way past the 30 day date range.
Here's my code.
Filter('Training Dates', 'EventDate' >= DateAdd(Today(),30,Days))
Still learning my way through all this so any help is appreciated.
Solved! Go to Solution.
Your formula does not specify an end of your range. So, anything past 30 days will be shown.
Please consider changing your Formula to the following:
Filter('Training Dates',
EventDate >= Today() &&
EventDate <= DateAdd(Today(),30,Days)
)
This will return anything from today's date and 30 days out.
I hope this is helpful for you.
Your formula does not specify an end of your range. So, anything past 30 days will be shown.
Please consider changing your Formula to the following:
Filter('Training Dates',
EventDate >= Today() &&
EventDate <= DateAdd(Today(),30,Days)
)
This will return anything from today's date and 30 days out.
I hope this is helpful for you.
That was incredibly helpful. I wasn't understanding how the 30 days part was working i thought the 30 days meant only look at 30 days out from the Today call. I was able to add that to my ClearCollect and am getting the correct data into my collection now! I owe you a drink.
Yep, that is all it takes. You can use that formula as-is on the Items property of your gallery as well - unless there is some need to duplicate all your data in-memory in a collection.
Glad it was helpful!
Well the end goal was to filter dates for specific classes in a ComboBox, so for me it was easier to just get a collection of the dates for that range rather than filter my final results, which already has a couple filters and as you can see I'm not so good at those lol.
The filter on my drop down if you're curios, there are three of those for each class.
If(
DataCardValue7.Selected.Value = "Front Desk Systems Training",
Sort(
Filter(
trDates,
Title = "Front Desk Systems Training"
).EventDate,
EventDate,
Ascending
),
Yeah, you might want to clean those up a bit. General rule of thumb is to *never* use If statements in your Items properties. It should be a function that is going to return the table of items you want...normally the Filter (embed your logic in the criteria of the Filter, not outside of the Filter). This just makes it easier to maintain, troubleshoot, and causes less issues with the app in general.
Keep at it...you'll get there! Just keep things in PowerApps super simple! 😁 If you find something is taking a lot of formulas and actions to do, then you are going the wrong way - pull back, think it over, and if stumped, post on the forum!
Yeah, you might want to clean those up a bit. General rule of thumb is to *never* use If statements in your Items properties. It should be a function that is going to return the table of items you want...normally the Filter (embed your logic in the criteria of the Filter, not outside of the Filter). This just makes it easier to maintain, troubleshoot, and causes less issues with the app in general.
Keep at it...you'll get there! Just keep things in PowerApps super simple! 😁 If you find something is taking a lot of formulas and actions to do, then you are going the wrong way - pull back, think it over, and if stumped, post on the forum!
User | Count |
---|---|
119 | |
86 | |
83 | |
74 | |
69 |
User | Count |
---|---|
215 | |
179 | |
140 | |
109 | |
83 |