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 Automate / Creating multiple Shifts
Power Automate
Answered

Creating multiple Shifts

(0) ShareShare
ReportReport
Posted on by 3

Hello,

 

I have successfully created a MS Shift instance using MS Graph using this thread and the graph documentation

 

However, I am trying to build several different larger scale schedule builders.  I have one that runs this HTTP post some 1400 times to enter 10 weeks of schedule data for 20 employees. (7 days * 10 weeks * 20 employees).  It takes about an hour and a half to run due to the numerous calls.  I would like to build a single HTTP post call and post a built text string.  So far, I can't get two manual shifts to create, though I have been able to get the first OR the second of 2 shifts to create.

 

Using the HTTP post action, I'm successfully posting:

 

 

{
"id": "",
"userId": "myId",
"schedulingGroupId": "myScheduleGroup",
"draftShift": {
"displayName": "test shift",
"notes": "",
"startDateTime": "2022-12-28T19:00:00Z",
"endDateTime": "2022-12-28T20:00:00Z",
"theme": "pink",
"activities": []
}
}

 

 

 

This works for the first shift:

 

 

{
 "id": "",
 "userId": "myId",
 "schedulingGroupId": "myScheduleGroup",
 "draftShift": {
 "displayName": "test shift",
 "notes": "",
 "startDateTime": "2022-12-28T19:00:00Z",
 "endDateTime": "2022-12-28T20:00:00Z",
 "theme": "pink",
 "activities": []
 }
},
{
 "id": "",
 "userId": "myId",
 "schedulingGroupId": "myScheduleGroup",
 "draftShift": {
 "displayName": "test shift",
 "notes": "",
 "startDateTime": "2022-12-29T19:00:00Z",
 "endDateTime": "2022-12-29T20:00:00Z",
 "theme": "pink",
 "activities": []
 }
}

 

 

 

And this works for the second shift (note the lack of a comma between the root {}  😞

 

 

{
 "id": "",
 "userId": "myId",
 "schedulingGroupId": "myScheduleGroup",
 "draftShift": {
 "displayName": "test shift",
 "notes": "",
 "startDateTime": "2022-12-28T19:00:00Z",
 "endDateTime": "2022-12-28T20:00:00Z",
 "theme": "pink",
 "activities": []
 }
}
{
 "id": "",
 "userId": "myId",
 "schedulingGroupId": "myScheduleGroup",
 "draftShift": {
 "displayName": "test shift",
 "notes": "",
 "startDateTime": "2022-12-29T19:00:00Z",
 "endDateTime": "2022-12-29T20:00:00Z",
 "theme": "pink",
 "activities": []
 }
}

 

 

 

I've tried wrapping the whole code snip in:

"value": {snip}

{snip}

"value": [snip]

[snip]

 

I've also tried building a compose action and an array variable.  The compose will load, but runs into the above issues, the variable doesn't seem to be available.

Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,830 Most Valuable Professional on at

    Hi @briandensmore,


    As far as I am aware the payload of the Create method only allows a single instance of a shiftitem for the draftShift & the sharedShift properties. Unfortunately, I have not seen any bulk create methods for shifts.

     

    Maybe you can suggest or upvote an idea for this on:

    https://techcommunity.microsoft.com/t5/microsoft-365-developer-platform/idb-p/Microsoft365DeveloperPlatform/label-name/Microsoft%20Graph

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 607

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard