Hello,
I have an application that is using a SharePoint list to collect data. I am trying to filter the gallery by year by using a dropdown. The data for the dropdown is coming from a Date and Time column in SharePoint that holds a full date i.e.:) 9/8/2021. I only want the dropdown to show the Years available from the Date and Time field in SharePoint.
Thanks
Solved! Go to Solution.
@cperry07
hi
On your dropdown you need to use the following
Distinct(yoursharepointname,Year(datetime field name))
but i would suggest that you dont directly filter you sharepointlist as you will run into delegation issues asafter 2000 rows of data.
To avoid this
Select your screen
then
Change to
in the formula 'bar' add the following
ClearCollect(ColYear, yoursharepointlistname)
Go back to you screen that your are filtering on and on the dropdown item change the formula to
Distinct(ColYear,Year(datetime field name))
this will avoid delegation issues
Hope that helps
gary
PS if it solves your issue please consider Thumbs up and mark as accept solution thanks 🙂
@cperry07
hi
On your dropdown you need to use the following
Distinct(yoursharepointname,Year(datetime field name))
but i would suggest that you dont directly filter you sharepointlist as you will run into delegation issues asafter 2000 rows of data.
To avoid this
Select your screen
then
Change to
in the formula 'bar' add the following
ClearCollect(ColYear, yoursharepointlistname)
Go back to you screen that your are filtering on and on the dropdown item change the formula to
Distinct(ColYear,Year(datetime field name))
this will avoid delegation issues
Hope that helps
gary
PS if it solves your issue please consider Thumbs up and mark as accept solution thanks 🙂
Hey Gary,
Thanks for your response.
The items in the dropdown are blank, am I missing something?
Chris
@cperry07
FYI
when you use ONVISIBLE at screen level to 'grab' a collection you need to navigate away and comeback for it to work as you have to actually trigger the formula because the screen is already visible 🙂
Gary
Hey Gary,
Had a follow up question. I am trying using a collection to use buttons and dropdowns to filter my gallery. I have buttons for "All" / "Pending" / "In Progress" / "Complete", I also have a dropdown where users can select an "Incident Name" then a button to apply that dropdown. I have now added the year dropdown and am trying to have the "Apply" button apply if there is a selection from the year dropdown. They are using a collection with the name ToggleCol2. I tried using an Or statement, but maybe i'm doing it incorrectly.
@cperry07
im lost lol
Could you detail it a little clearer as in what a user would do?
Gary
Sorry I butchered my above post LOL. That's what I get for multi-tasking. Yes, I would like to filter the gallery where a user could select a button or a dropdown.
@cperry07
so what are your buttons/dropdowns you want to filter on called (what did you name each of them)
is this how you want it to work
User Selects
one of these buttons - "All" / "Pending" / "In Progress" / "Complete"
Then selects - "Incident Name"
Then Selects Year dropdown
then selects apply button
is that right?
gary
User | Count |
---|---|
255 | |
106 | |
85 | |
51 | |
43 |