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.
Filter('Fleet',ID <> any vehicle ID of the 'Fleet Schedule' list for the data range selected.
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.
@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?
Check out the News & Announcements to learn more.
Did you know that you can visit the Power Query Forum in Power BI and now Power Apps
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.
Check out our new Discover Your Career Path blog post series and get all the details.