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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Pull the Team Shifts a...
Power Automate
Unanswered

Pull the Team Shifts and insert in excel

(0) ShareShare
ReportReport
Posted on by 45

Hello, 

 

I'm new to the PA, I would like to create a flow where Shifts pull from the Microsoft Shifts and Insert the data into an Excel file, From the Excel file PA will read the status and it will change in another SharePoint list. (This second part is done but unable to pull Shift data to Excel)

 

E.g. I would like to pull whatever shift name is available for the day, say for one person 8 in the morning is online status 12 would be email status and 4 would be Offline status, this should be pulled and inserted in Excel. Snap attached

 

Thanks for the help! 🙂 

Categories:
I have the same question (2)
  • Verified answer
    ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @JacksonDas 

     

    Pls refer the below sample flow to fetch shifts based on today's date and save details into excel sheet.

     

    Here, the Input excel has been uploaded on SharePoint document library with table created in it:

    ManishSolanki_0-1694327716062.png

     

    Here are the actions which you can used for saving shifts details in excel sheet:

    1. Add "List Shifts" action to get all the shifts for a team. Select the team from the drop down and to filter the shift for a day, we need to write an expression in "From Start Time" & "To End Time":

    ManishSolanki_1-1694328021374.png

    Expression used for Start time parameter:

    @{startOfDay(utcNow())}

    Expression used for End time parameter:

    @{startOfDay(addDays(utcNow(),1))}

     

    Next, we iterate the shift list using "Apply to each" action and get the details like assigned to, start time, end time & notes:

    ManishSolanki_2-1694328224729.png

     

    Now, as shift list returns the user id of the assigned to so we add "Get user profile" action to get the name from the user id:

    ManishSolanki_3-1694328304072.png

    Expression used in the above screenshot:

    item()?['userId']

     

    Finally, we will use "Add a row in table" action to add the details in the excel sheet:

    ManishSolanki_4-1694328447697.png

    Choose the Display Name from the dynamic content returned by "Get user profile" action

    For other columns - start time, e:nd time & notes, I have used expressions:

    Fields or Columns Expression
    Start Time
    convertFromUtc(item()?['sharedShift/startDateTime'],'India Standard Time','MM-dd-yyyy hh:mm tt')
    End Time
    convertFromUtc(item()?['sharedShift/endDateTime'],'India Standard Time','MM-dd-yyyy hh:mm tt')
    Notes
    item()?['sharedShift/notes']

    here, I have converted UTC time to IST, pls modify the time zone as per your need.

     

    The output obtained by this flow:

    ManishSolanki_5-1694328717330.png

     

    I hope this will give you some idea to start designing the desired flow.

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • JacksonDas Profile Picture
    45 on at

    @ManishSolanki , It's a great help. Thank you so much for your insight on this. 

     

  • JamieC3 Profile Picture
    2 on at

    Hi @ManishSolanki,

     

    Update, all sorted now - below problem was due to my learning curve.

    ------------------------------------------------------------------------------

     

    Thank you for the flow above - when I re-create this flow for myself, the display name being shown is that of the staff member who created the shift, not the display name of the staff member who has been assigned the shift?

     

    Not sure where I'm going wrong?  As I need the display names the staff members how have been assigned/given the shift to work.

     

    Regards

     

    Jamie

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard