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.
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.
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-ne... , 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?
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.
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?
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
User | Count |
---|---|
257 | |
110 | |
90 | |
51 | |
44 |