Hello,
How can I filter date values within my dropdown field in my PowerApps form? This dropdown field is based on a lookup column within my SharePoint list called (MeetingDates). The lookup column (MeetingDates) and source list column (StartDate) store dates in MM/dd/yyyy format.
I want to be able to hide the dates that have passed in the dropdown without deleting them from the source list. How can I achieve this?
Ex. 7/4/2022 (Should be hidden)
7/11/2022 (Should be hidden)
7/18/2022 (Would be hidden after today)
You will need to simply filter the records of the MeetingDates list in your Items property for the control.
If you are currently using Choices, then you will need to realize that this will change the schema of the records in the control. Meaning that, to your app, the records will no longer be records with an Id and Value column, but will be the full record from the list.
However, you can compensate for that in your Items property if you need to.
Also, what kind of column is StartDate? If it is a Date column, then you need not worry about the format of it...a date is a date!
As an Example of the above assuming that StartDate is a date column, your Items property would be:
ForAll(
Filter(MeetingDates, StartDate>Today()),
{Id: ID,
Value: Title
}
)
I hope this is helpful for you.
thank you very much for your response. I think I understood what you mean.
I should've been a little more detailed, sorry about that.
StartDate is indeed a Date column. I'm also confident the code you provided would work but I'm unsure if it would with my current form and its DataSource connection.
My SharePoint setup is:
List 1 (Master list w/the form and lookup/dropdown field I'm trying to filter - (MeetingDates)
List 2 (Source list, MeetingDates is looking up from the (StartDate) column here
Would the code still apply or would it need to be adjusted?
The code I've attempted before that didn't work was:
Filter(list 1,MeetingDates<Today())
Tell me more about the setup.
Is it simply the dropdown/combobox that you want to filter based on the MeetingDates?
And, you mention a Form...is this all in a Form, and if so, what is the Source of the Form?
Unless there is something odd in any of the above, what I provided you should give you what you need.
Sure, below is what I got when I attempted to put the code into the items property for the MeetingDates field.
Yes, I would only like for the drop down to filter the meeting dates. The source of the form is from List 1 and the source of MeetingDates is from List 2.
User | Count |
---|---|
124 | |
87 | |
86 | |
75 | |
69 |
User | Count |
---|---|
214 | |
181 | |
140 | |
96 | |
83 |