Shifts
Captures detailed shift assignments, including assigned user, start and end times, and optional shift notes.
Table Specific Information
Select
Query the Shifts table by retrieving everything from teams or by specifying TeamId with = and IN operators. By default only the shifts for teams of the groups you are a member of will be returned. To retreive shift items for teams of all groups in your organization, set IncludeAllGroups property to true. The component will use the Microsoft Teams API to process WHERE clause conditions built with the following columns and operators. The rest of the filter is executed client side within the component.
- TeamId supports the '=' and IN operators.
- Id supports the '=' operator.
For example, the following queries are processed server side:
SELECT * FROM Shifts WHERE TeamId IN ('da838338-4e77-4c05-82a6-79d9f0274511', 'da834568-4df7-4c05-82a6-79d9f0274515')
SELECT * FROM Shifts WHERE Id = 'SHFT_aac21ce9-82b3-4ad1-a841-dadb570c8ebf' AND TeamId = 'da838338-4e77-4c05-82a6-79d9f0274511'
Insert
To insert a shift into the team schedule, you need to specify TeamId, UserId to whom this timeoff is assigned and at least one of the DraftShift or SharedShift information including the startDateTime and endDateTime of the timeoff.
INSERT INTO Shifts (TeamId, UserId, draftShift_startDateTime, draftShift_endDateTime) VALUES ('da838338-4e77-4c05-82a6-79d9f0274511', '0409f710-2aa9-4f05-8944-ef382160f1d1', '2019-07-17T07:00:00Z', '2019-07-17T15:00:00Z')
INSERT INTO Shifts (TeamId, UserId, sharedShift_startDateTime, sharedShift_endDateTime) VALUES ('da838338-4e77-4c05-82a6-79d9f0274511', '0409f710-2aa9-4f05-8944-ef382160f1d1', '2019-07-17T07:00:00Z', '2019-07-17T15:00:00Z')
Update
To update a shift record Id and TeamId are required in WHERE clause. You can update any other field other than TeamId, Id and CreatedDateTime.
UPDATE Shifts SET draftShift_theme = 'blue', draftShift_displayname = 'somename' WHERE Id = 'SHFT_aac21ce9-82b3-4ad1-a841-dadb570c8ebf' AND TeamId = 'da838338-4e77-4c05-82a6-79d9f0274511'
Delete
To delete a shift record Id and TeamId are required in WHERE clause.
DELETE FROM Shifts WHERE TeamId = 'da838338-4e77-4c05-82a6-79d9f0274511' AND Id = 'SHFT_aac21ce9-82b3-4ad1-a841-dadb570c8ebf'
Columns
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | False |
A unique identifier for the shift record. |
| TeamId | String | False |
The identifier of the Microsoft Team to which this shift belongs. |
| UserId | String | False |
The unique identifier of the user assigned to this shift. |
| CreatedDateTime | Datetime | False |
The date and time when the shift was first created. |
| IsStagedForDeletion | Bool | False |
Indicates whether the shift is marked for deletion but has not yet been removed. |
| LastModifiedBy_application_displayName | String | False |
The name of the application that most recently modified the shift. |
| LastModifiedBy_application_id | String | False |
The unique application ID of the system or app that last updated the shift. |
| LastModifiedDateTime | Datetime | False |
The date and time of the last update to the shift. |
| DraftShift_activities | String | False |
A list of segments in the draft version of the shift, such as work assignments, breaks, or lunches, specifying what the employee is doing and when. |
| DraftShift_displayName | String | False |
A label assigned to the draft version of the shift for easier identification in the schedule. |
| DraftShift_notes | String | False |
Optional notes added to the draft shift, such as instructions or important reminders. |
| DraftShift_startDateTime | Datetime | False |
The scheduled start time of the draft shift. |
| DraftShift_endDateTime | Datetime | False |
The scheduled end time of the draft shift. |
| SchedulingGroupId | String | False |
The identifier of the scheduling group to which this shift is assigned. |
| SharedShift_activities | String | False |
A list of activities in the published (shared) version of the shift, such as assignments, breaks, or other scheduled duties. |
| SharedShift_displayName | String | False |
A label assigned to the shared version of the shift for users to see on the calendar. |
| SharedShift_notes | String | False |
Optional notes attached to the shared version of the shift for team member reference. |
| SharedShift_startDateTime | Datetime | False |
The published start time of the shift that is visible to the user. |
| SharedShift_endDateTime | Datetime | False |
The published end time of the shift that is visible to the user. |