Forum Discussion
Filter my Gallery by Current Month
Hi ADumith , I recommend setting a variable on start for the current month, formatted to match the format in your source list, then after you've set that variable create your collection filtered by that variable. You would than set the collection as the source for the gallery.
- ADumithApr 14, 2022Iron Contributor
Great idea,
I did this:
In the items I added this:
In my list the field is set like a single line text, so mi record has 04 instead of 4.
Where is the error? 😞
Thanks in advance,
- jonlakeApr 14, 2022Iron Contributor
Hi ADumith , immediately after you create the variable on start, add a line to create your collection, something like this: ClearCollect(colBirthDayWorkAnniversary,Filter(birthday_and_workanniversary,mbirth=varMonths));
Your gallery object items would then use the newly populated collection (in my example the SharePoint list is named 'birthday_and_workanniversary').
- ADumithApr 15, 2022Iron Contributor
Thanks for your time,
I renamed the list to avoid errors.
So the code in the OnStart method looks like this:
Set(varMonths, Text(Today(),"mm"));
ClearCollect(colBirthDayWorkAnniversary,Filter(EmployeesDirectory,Mbirth=varMonths))Then in the gallery DATA property I put what I understand would be the name of the collection, I mean, colBirthDayWorkAnniversary
When I run the apps no record is shown in the gallery. Am I skipping a step?
Thanks again,