Am having difficulty figuring out the exact syntax to achieve the following:
In my gallery I have a label that shows a date LblActualExpirydate It's a calculated label with the details formatted as follows:
I want to filter the gallery for items where LblActualExpirydate is today +30 or less
They are all labels ! so I know I need to format them as date values rather than string but struggling with that also..
Solved! Go to Solution.
Hi @vfdd ,
How about this:
//With this formula, you can filter the data on Gallery Filter('Employee Details',Text(Created,"[$-en-US]dd-mm-yyyy") = DateAdd(DateValue(Label40.Text),-30,Days)) // This will convert the dates on the label to date value DateValue(If(IsBlank(LblExpiryDate.Text),LblCalcExpiryDate.Text,LblExpiryDate.Text))
Now using these 2 formulas you can try one more time. In your reply, you said, "But I now want to filter the gallery based on the actual expiry date" this validation against which date??? if it is on the same date try below:
//With this formula, you can filter the data on Gallery Filter('Employee Details',DateValue(If(IsBlank(LblExpiryDate.Text),LblCalcExpiryDate.Text,LblExpiryDate.Text)) = DateAdd(DateValue(If(IsBlank(LblExpiryDate.Text),LblCalcExpiryDate.Text,LblExpiryDate.Text)),+30,Days))
In the above, I am filtering the gallery with the expiry in the next 30 days.
I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.
thanks @KrishnaV I think your 2nd one might work, so doing the calculation in the filter text. But can't quite get it.. the 2nd part of your formula above gives me red squigly lines !! have tried it a few ways. I do think that if I can do the calculation at source as per Pstork suggestion in sharepoint then that also would solve the issue. but again I can't get that right 😞
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!