web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter collection of s...
Power Apps
Unanswered

Filter collection of shifts does not work

(0) ShareShare
ReportReport
Posted on by 102

I want to get users who are working right now. 

 

So I started with

ClearCollect(col_shifts;ShiftsforMicrosoftTeams.ListShifts("xxxxxxx Team ID").value)

 

Filter(col_shifts;sharedShift.startDateTime<DateValue(Text(Now();UTC));sharedShift.endDateTime>DateValue(Text(Now())))

 

But in my gallery no items are shown. 

 

 

Categories:
  • superfliege Profile Picture
    91 on at

    It's really hard with your entire filter to tell you a solution here.


    You can try to convert the data as a common format.
    For Example on both sides you should convert to Text(DateTimeValue(ArrivalDateTime.Text), DateTimeFormat.LongDateTime)
    Source: https://docs.microsoft.com/de-de/power-apps/maker/canvas-apps/show-text-dates-times

     

    Of course you can also display the filter input for debugging in multiple text fields. This always helps me a lot when I want to compare values. Often I notice that a date conversion was wrong.

    I hope this helps you.

     

  • Phil_NPO Profile Picture
    102 on at

    I tried you some different DateTimeValues like you wrote. Maybe the problem is because of the dataset. 

     

    I found an old thread https://powerusers.microsoft.com/t5/Building-Power-Apps/ShiftForMicrosoftTeams-I-can-only-see-the-next-2-weeks-shifts/m-p/891182/highlight/true#M282927 , there you can use StartTime and EndTime, but in my dataset i cannot find StartTime and EndTime directly. There is DraftShift and SharedShift with attributes like StartDateTime and EndDateTime. 

     

    Is this the reason why I cannot filter? How can I get these Attributes like SharedShift.StartDateTime to add it to a new column?

    Screenshot 2022-08-19 100425.png

     

  • superfliege Profile Picture
    91 on at

    Yes it looks like you are not going to the date field value but somehow to another dataset.

    Try to address here this dataset SharedShift.StartDateTime. after the point there should be more values here.

    Often it works to put First() in front of it, but I don't know your data structure for that.

    Try also to display your comparison values in labels.

  • Phil_NPO Profile Picture
    102 on at

    Well, this is not my own dataset, it is the result of ListShifts.

     

    After the point of SharedShift.StartDateTime there are no more values. 

     

    Can you describe how to copy SharedShift.StartDateTime to a new column in the collection table?

  • superfliege Profile Picture
    91 on at

    Oh sorry, I misunderstood something.

    You can see how to copy the value to a new column here. You might also be able to use this to create a new collection and view the values directly. That should help you troubleshoot:

    https://docs.microsoft.com/en-us/power-platform/power-fx/reference/function-table-shaping

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 360 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 325

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard