Shifts
Shifts table for MSTeams data provider.
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 add-in 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 add-in.
- 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 |
ID of the shift. |
TeamId | String | False |
The Team Id. |
UserId | String | False |
ID of the user assigned to the shift. |
CreatedDateTime | Datetime | False |
The timestamp on which this shift was first created. |
LastModifiedBy_application_displayName | String | False |
The display name of the application that last modified. |
LastModifiedBy_application_id | String | False |
The id of the application that last modified. |
LastModifiedDateTime | Datetime | False |
The timestamp on which this shift was last updated. |
DraftShift_activities | String | False |
An incremental part of a shift which can cover details of when and where an employee is during their shift. For example, an assignment or a scheduled break or lunch. |
DraftShift_displayName | String | False |
The shift label of the shiftItem. |
DraftShift_notes | String | False |
The shift notes for the shiftItem. |
DraftShift_startDateTime | Datetime | False |
The start date and time for the Draftshift |
DraftShift_endDateTime | Datetime | False |
The end date and time for the Draftshift |
SchedulingGroupId | String | False |
ID of the scheduling group the shift is part of. |
SharedShift_activities | String | False |
An incremental part of a shift which can cover details of when and where an employee is during their shift. For example, an assignment or a scheduled break or lunch. |
SharedShift_displayName | String | False |
The shift label of the shiftItem. |
SharedShift_notes | String | False |
The shift notes for the shiftItem. |
SharedShift_startDateTime | Datetime | False |
The start date and time for the Sharedshift |
SharedShift_endDateTime | Datetime | False |
The end date and time for the Sharedshift |