cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SteKo-Smart
Regular Visitor

Microsoft Shifts - Get all approved "holiday" for the current yearfor one team member

Hi Community,

 

how could i get all approved holidays for the current year.

I tryed with:

 

 

 

CountIf(
    ShiftsforMicrosoftTeams.ListTimeOffRequests(
        DropdownTeamauswahl.Selected.id;
        {
            '$top': 100;
            state: "approved"
        }
    ).value;
    Len(id) > 0
)

 

 

 

but this returns me just a list with all approved items.

Who could i filter this to 01.01.2021 till 23.12.2021?

We would know hoe many time the user spend on holidays. Any idea?

 

Kind regards

 

1 REPLY 1
Expiscornovus
Super User
Super User

Hi @SteKo-Smart,

 

You could use the timeoffreasonid and the startdatetime fields of the ListTimeOffRequest method to filter your items. The Timeoffreasonid values can be found in the ListTimeOffReasons method.

 

Below is an example of those filters:

I am using a Year function to filter it for the current year.

CountRows(Filter(ShiftsforMicrosoftTeams.ListTimeOffRequests("83fc6a8d-ff08-4e74-90a3-7c3b8ee12d9a",{'$top':100, state:"approved"}).value, timeOffReasonId = "TOR_e5180be4-6ca6-48f9-babf-d9bd4aa04d1a", Year(startDateTime) = Year(Now())))

 

countrows_shifts.png



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,382)