OpenShifts
Shifts table for MSTeams data provider.
Table Specific Information
Select
Query the OpenShifts table by retrieving everything from teams or by specifying TeamId with = and IN operators. By default only the open shifts for teams of the groups you are a member of will be returned. To retreive open shift items for teams of all groups in your organization, set IncludeAllGroups property to true. The cmdlet 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 cmdlet.
- TeamId supports the '=' and IN operators.
- Id supports the '=' operator.
For example, the following queries are processed server side:
SELECT * FROM OpenShifts WHERE TeamId IN ('da838338-4e77-4c05-82a6-79d9f0274511', 'da834568-4df7-4c05-82a6-79d9f0274515') SELECT * FROM OpenShifts WHERE Id = 'OPNSHFT_2d49e6dd-d965-4ea2-a399-37f2a082852c' AND TeamId = 'da838338-4e77-4c05-82a6-79d9f0274511'
Insert
To insert an open shift into the team schedule, you need to specify TeamId, at least one of the DraftOpenShift or SharedOpenShift information including the startDateTime and endDateTime.
INSERT INTO OpenShifts (TeamId, draftopenshift_openslotcount, draftopenshift_startDateTime, draftopenshift_endDateTime) VALUES ('da838338-4e77-4c05-82a6-79d9f0274511', 4, '2020-09-16T10:00:00.000Z', '2020-09-16T18:00:00.000Z')
Update
To update an open shift record Id and TeamId are required in WHERE clause. You can update any other field other than TeamId, Id and CreatedDateTime.
UPDATE OpenShifts SET draftOpenShift_theme = 'blue' WHERE Id = 'OPNSHFT_2d49e6dd-d965-4ea2-a399-37f2a082852c' AND TeamId = 'da838338-4e77-4c05-82a6-79d9f0274511'
Delete
To delete a shift record Id and TeamId are required in WHERE clause.
DELETE FROM OpenShifts WHERE TeamId = 'da838338-4e77-4c05-82a6-79d9f0274511' AND Id = 'OPNSHFT_2d49e6dd-d965-4ea2-a399-37f2a082852c'
Columns
Name | Type | ReadOnly | Description |
Id [KEY] | String | False |
ID for the scheduling group that the open shift belongs to. |
CreatedDateTime | Datetime | False |
Timestamp at which the openshift was 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 openshift was last updated. |
DraftOpenShift_openSlotCount | Int | False |
OpenSlotCount of DraftOpenShift |
SchedulingGroupId | String | False |
The SchedulingGroupId. |
SharedOpenShift_openSlotCount | Int | False |
OpenSlotCount of SharedOpenShift |
TeamId | String | False |
The Team Id. |
DraftOpenShift_displayName | String | False |
The shift label of the shiftItem.. |
DraftOpenShift_notes | String | False |
The shift notes for the shiftItem.. |
DraftOpenShift_StartDateTime | Datetime | False |
StartDateTime of DraftOpenShift |
DraftOpenShift_EndDateTime | Datetime | False |
EndDateTime of DraftOpenShift |
SharedOpenShift_displayName | String | False |
The shift label of the shiftItem.. |
SharedOpenShift_notes | String | False |
The shift notes for the shiftItem.. |
SharedOpenShift_StartDateTime | Datetime | False |
StartDateTime of SharedOpenShift |
SharedOpenShift_EndDateTime | Datetime | False |
EndDateTime of SharedOpenShift |