cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

Filter on list multiple dynamic values

I am building a fleet management and scheduling app.

 

Two SharePoint lists; 

Fleet - this is a list of al vehicles

Fleet Schedule - This is a checked out list. It has a Checkout, CheckIn and looking field back to the Fleet list. So it basically a list of dates and the vehicle that is checked out.

 

In PowerApps I am using a calendar component to select a data range of when they need to reserve a vehicle.  I need a gallery that shows the Fleet list and filters out the vehicles that are already checked out for that data range. 

Just as a test I have a gallery of unavailable vehicles for the date range selected so I was trying to filter the Fleet list based on filtering out the vehicles that are unavailable.

 

Not sure I am approaching this correctly but was trying to filter based on the ID of multiple records.

 

 

Something like...

 

Filter('Fleet',ID <> any vehicle ID of the 'Fleet Schedule' list for the data range selected.

 

Thank you 

3 REPLIES 3
Highlighted
Super User II
Super User II

Re: Filter on list multiple dynamic values

This will be tricky to make delegable, so be mindful of the potential for some data to not be included.

 

However, what you're describing is possible. Unfortunately, the NOT operator is not supported by SharePoint.

 

If you bring your data into your app in Collections, you'll have options for those types of queries.

 

Filter(
    colOne,
    Not(
        FieldName.Id in Filter(
            colTwo,
            DateField > DateCriteria,
        ).ID
    )
)

 

Something like the above. The date filtering part will be more elaborate than that, but that should give you the idea.

Highlighted
Helper V
Helper V

Re: Filter on list multiple dynamic values

Great, I will give it a try with Collections.

Highlighted
Helper V
Helper V

Re: Filter on list multiple dynamic values

@GarethPrisk The "ID" has an error "Can not covert this data type. PowerApps can not convert this Number to a Record."  Any recommendation for this issue?

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (7,179)