cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
snipesnab
Helper II
Helper II

Filter SharePoint list in PowerApps Gallery - something is not work as expected, can't figure it out - Please help

Hi All,

I have an app I am working on that is used for booking desks. 

 

There is a gallery that should filter the bookings shown in the gallery based on user email address AND where the 'Check Out From Number' (which is a date converted to a number) is >= Todays date converted to a number value.

I have included snippets of the gallery filter statement and the SharePoint list.

 

For some reason it shows booking dates that have past today's date, cant figure out why. The email address part of the filter is working as expected, it's the number part that is not. Please help?

 

Please see attachments.

 

 

7 REPLIES 7
CNT
Super User
Super User

@snipesnab Can you post the formula as a text in the chat.

AmDev
Super User
Super User

Hi @snipesnab 

 

Can you try using the DateDiff function on the original Checkoutfrom date instead of converting and just filter on everything that has a positive nr of days?

 

DateDiff( CheckoutFrom, Today()) > 0

 

You might need to use Date Value to align the formats, but this should work

 

Hope this helps - Good Luck! ☘

FirstN(
SortByColumns(
Filter(
'Desk Reservations',
'Reserved By'.Email = currentUser.Email && 'Check Out From Number' >= Value(
Text(
Today(),
"yyyymmddhmm"
)
)
),
"CheckOutFromNumber",
Ascending
),
2
)

Ternioo
New Member

Hi @snipesnab I made an excel file with your data and maybe found a solution for your problem.

 

What if you use you Column named: Check Out From (as Date) and compare that data with today's date. Does it works for you?

 

Because if so, you can just use the following formula and you Gallery might work just fine:

 

&& DateValue('Check Out From') >= DateValue(Today())

 

 

Hope it helps.

Thank You

Thanks, seems to work but does it matter about the warning - see image below:

snipesnab_0-1638291257049.png

 

Thanks, your solution seems to work however I also get the following delegation warning:

 

snipesnab_2-1638291574622.png

 

 

Ternioo
New Member

I think now the problem is the && (and) part of the formula. 

Try instead of using &&, just put a , (comma) between the two conditions, power apps will understand that inside a filter function.

Plus, see the video below for more understanding about the filter function and delegation problems

Learn to use the PowerApps Filter function - YouTube

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (2,693)