UserGroups
Query, create, update or delete information regarding groups to manage a set of common records.
Table-Specific Information
Select
The driver uses the Zoho CRM API to process WHERE clause conditions built with the following columns and operators.
- Id supports the '=' operator.
- Name supports the '=', 'LIKE' and 'NOT LIKE' operators.
For example, the following queries are processed server side:
SELECT * FROM UserGroups WHERE Id = '1170218000000627002'; SELECT * FROM UserGroups WHERE Name = 'text'; SELECT * FROM UserGroups WHERE Name LIKE '%text%'; SELECT * FROM UserGroups WHERE Name LIKE '%text'; SELECT * FROM UserGroups WHERE Name LIKE 'text%'; SELECT * FROM UserGroups WHERE Name NOT LIKE '%text%';
Insert
To create a UserGroup with sources, use the Sources pseudo-column.'Name' is a required column for insertion.
Please note that to insert a source of type 'user_groups', you must pass the source's type as 'groups' in the aggregate or TEMP table.
INSERT INTO UserGroups (Name, Description, Sources) VALUES ('text', 'description text', '[{"source":{"id":"1170218000000428001"},"type":"users"},{"source":{"id":"1170218000000627100"},"type":"roles","subordinates":true},{"source": {"id": "1170218000000627136"}, "type":"groups"}]');
You can also use TEMP tables to create a UserGroup with multiple sources.
INSERT INTO UserGroupSources#TEMP (SourceId, Type) VALUES ('1170218000000627061', 'users');
INSERT INTO UserGroupSources#TEMP (SourceId, Type, Subordinates) VALUES ('1170218000000031154', 'roles', true);
INSERT INTO UserGroupSources#TEMP (SourceId, Type, Subordinates) VALUES ('1170218000000627117', 'territories', false);
INSERT INTO UserGroupSources#TEMP (SourceId, Type) VALUES ('1170218000000627002', 'groups');
INSERT INTO UserGroups (Name, Description, Sources) VALUES ('text', 'description text', UserGroupSources#TEMP);
Update
Specify the Id in the WHERE clause when executing an update in this table. Name, Description and Sources can be updated.
To delete an existing source from a UserGroup, you must pass the '_delete' key with the value 'true' in the sources aggregate for each source you want to delete.
To update a source of type 'user_groups', you must pass the source's type as 'groups' in the aggregate or TEMP table.
UPDATE UserGroups SET Name = 'text', Description = 'description text', Sources = '[{"source":{"id":"1170218000000627100"},"type":"roles", "_delete": true}]' WHERE Id = '1170218000000627002';
You can also use TEMP tables to update sources of a UserGroup. To delete a particular source, you must set the 'DeleteSource' column of the temp table 'UserGroupSources#TEMP' as true.
INSERT INTO UserGroupSources#TEMP (SourceId, Type, DeleteSource) VALUES ('1170218000000627117', 'territories', true);
UPDATE UserGroups SET Name = 'text', Description = 'description text', Sources = 'UserGroupSources#TEMP' WHERE Id = '1170218000000627002';
Delete
Specify the Id in the WHERE clause when executing a delete in this table.
DELETE FROM UserGroups WHERE Id = '1170218000000664005';
Columns
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
A unique numeric identifier for the user group. |
| Name | String | False |
The name of the user group. |
| Description | String | False |
A small description regarding the user group. |
| CreatedByName | String | True |
The name of the user who created this user group. |
| CreatedById | String | True |
The id of the user who created this user group. |
| CreatedAt | Datetime | True |
The time this user group was created. |
| ModifiedByName | String | True |
The name of the user who modified this user group. |
| ModifiedById | String | True |
The id of the user who modified this user group. |
| ModifiedAt | Datetime | True |
The time this user group was last modified. |
| SourcesCountUsers | Integer | True |
The number of users in this group. |
| SourcesCountRoles | Integer | True |
The number of roles in this group. |
| SourcesCountTerritories | Integer | True |
The number of territories in this group. |
| SourcesCountGroups | Integer | True |
The number of groups included in this group. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.
| Name | Type | Description |
| Sources | String |
Used for adding or updating sources in a user group. |