English
Fx.tag
About 1635 wordsAbout 5 min
2026-01-09
1. findTagDefine Find applicable tags for the object
Find applicable tags for objects
Fx.tag.findTagDefine(<string objectApiName>)
Request parameters
Request Body
| Parameter Name | object | Description | Required |
|---|---|---|---|
| objectApiName | string | Object API name | Y |
Return Parameters
| Parameter Name | APIResult | Description |
|---|---|---|
| isError | boolean | Indicates whether an error occurred |
| data | QueryResult | Returned data |
| message | string | Message |
| data | QueryResult | Returned data |
|---|---|---|
| dataList | array[object] | |
| size | integer | Current count |
| total | integer | Total count |
| dataList | object | Tag description |
|---|---|---|
| tagGroup | string | Tag group name |
| tagGroupId | string | Tag group ID |
| tagId | string | Tag ID |
| tagApiName | string | Tag API name |
| name | string | Tag name |
| tagGroupApiName | string | Tag group API name |
Return an example
{
"isError": false,
"data": {
"dataList": [
{
"tagGroup": "lzhh-tag",
"tagGroupId": "66d981dde18ae10007ce06f3",
"tagId": "66d981dde18ae10007ce06f4",
"tagApiName": "label_Uj3sC__c",
"name": "lzhh tag name 2",
"tagGroupApiName": "group_RW66c__c"
}
],
"size": 1,
"total": 1
},
"message": ""
}Code examples
APIResult ret = Fx.tag.findTagDefine("object_76is3__c")
log.info(ret)Reference Interface
- Reference guide: null
2. findTagById Retrieve all tags associated with a specific data entry
Retrieve all tags on a specific data record
Fx.tag.findTagById(<string objectApiName>, <string dataId>)
Request parameters
Request Body
| Parameter Name | object | Description | Required |
|---|---|---|---|
| objectApiName | string | Y | |
| dataId | string | Y |
Return Parameters
| Parameter Name | APIResult | Description |
|---|---|---|
| isError | boolean | Indicates whether an error occurred |
| data | array[object] | List of returned data |
| message | string | Message |
| data | object | Tag information |
|---|---|---|
| tagId | string | Tag ID |
| name | string | Tag name |
Return an example
{
"isError": false,
"data": [
{
"tagId": "642fb2458085c60001d03744",
"name": "2"
}
],
"message": ""
}Code examples
APIResult ret = Fx.tag.findTagById("obj_lzhh_pure__c", "66d956ca0410610007694b99")
log.info(ret)3. update tag for data modification
Update data labels
Fx.tag.update(<string objectApiName>, <string dataId>, <array tagIdList>)
Request parameters
Request Body
| Parameter Name | object | Description | Required |
|---|---|---|---|
| objectApiName | string | Y | |
| dataId | string | Y | |
| tagIdList | array[string] | Y |
Return Parameters
| Parameter Name | APIResult | Description |
|---|---|---|
| isError | boolean | Indicates if an error occurred |
| data | string | ID of the updated tag |
| message | string | Message |
Return an example
{
"isError": false,
"data": "66d956ca0410610007694b99",
"message": ""
}Code examples
def (Boolean error, String data, String errorMessage) = Fx.tag.update("obj_lzhh_pure__c", "66d956ca0410610007694b99", [])
log.info(data)Notice
- An empty list will remove all tags.
- The system will verify if the tags are compatible with the data. If not, it will return an error with
error=true.- If the error message is
Error in bulkHangTagForData, the likely cause is that the tags are not applicable to the current object.- You can use
Fx.tag.findTagDefineto look up compatible tags.
4. createTag Create Tag
Create Tag
Fx.tag.createTag(<string description>, <string groupId>, <string tagApiName>, <string tagName>)
Request parameters
Request Body
| Parameter Name | object | Description | Required |
|---|---|---|---|
| description | string | Y | |
| groupId | string | The ID of the tag group, which must already exist | Y |
| tagApiName | string | Y | |
| tagName | string | Y |
Return Parameters
| Parameter Name | APIResult | Description |
|---|---|---|
| isError | boolean | Indicates whether an error occurred |
| data | string | The ID of the generated label |
| message | string | Message |
Return an example
{
"isError": false,
"data": "66da75ab6a3bb50007ad52de",
"message": ""
}Code examples
def arg = TagArg.builder()
.groupId("5ea3b0e5e1a70b0001e2f65b")
.tagApiName("tag_scDwW_tesat2__c")
.tagName("Function Created Tag 1-aafj-test2")
.description("test001")
.build();
APIResult ret = Fx.tag.createTag(arg)
log.info(ret)Reference Interface
- Reference guide: TagArg
Notice
- The tag group must already exist
5. updateTag Update Tag
Update Tag
Fx.tag.updateTag(<string description>, <string groupId>, <string tagId>, <string tagName>)
Request parameters
Request Body
| Parameter Name | object | Description | Required |
|---|---|---|---|
| description | string | Y | |
| groupId | string | Y | |
| tagId | string | Y | |
| tagName | string | Y |
Return Parameters
| Parameter Name | APIResult | Description |
|---|---|---|
| isError | boolean | Indicates whether an error occurred |
| data | null | |
| message | string | Message information |
Return an example
{
"isError": false,
"data": null,
"message": ""
}Code examples
def arg = TagArg.builder()
.groupId("5ea3b0e5e1a70b0001e2f65b")
.tagId("66da75ab6a3bb50007ad52de")
.tagName("function-sign03-f--asas---j")
.description("Update tag 3")
.build()
def result = Fx.tag.updateTag(arg)Reference Interface
- Reference guide: TagArg
Notice
- The update is performed asynchronously, so this function does not return a value. You can check whether the modification was successful by using Fx.tag.findTagByTagIds.
6. createTagGroup Create Tag Group
Create Tag Group
Fx.tag.createTagGroup(<String api_name>, <String tag_group_name>, <String describe_api_names>, <String is_applied_to_all>)
Request parameters
Request Body
| Parameter Name | Type | Description | Required |
|---|---|---|---|
| api_name | String | Group API name | Y |
| tag_group_name | String | Group name | Y |
| describe_api_names | String[string] | Applicable object list | Y |
| is_applied_to_all | String | Whether applicable to all objects | Y |
Return Parameters
| Parameter Name | Type | Description |
|---|---|---|
| tagDescribe | object |
| tagDescribe | object | Description |
|---|---|---|
| createTime | Interger | Creation time |
| deleted | Boolean | Whether deleted |
| isActive | Boolean | Whether disabled |
| apiName | String | Group API name |
| lastModifiedBy | String | Last modified by |
| tagRange | List[string] | Applicable object list |
| isAll | Boolean | Whether applicable to all objects |
| tagDefineType | String | Type |
| groupDescription | String | Group description |
| tenantId | String | Tenant ID |
| createdBy | String | Created by |
| id | String | Group ID |
| type | String | Group name |
| lastModifiedTime | Integer | Last modified time |
Return an example
{
"createTime": 1728649707933,
"deleted": false,
"isActive": true,
"apiName": "group_YpkQ3__c",
"lastModifiedBy": "1000",
"tagRange": [
"MarketingKeywordObj",
"EnterpriseInfoObj"
],
"isAll": false,
"tagDefineType": "custom",
"groupDescription": "Solid practical plan",
"tenantId": "78057",
"createdBy": "1000",
"id": "670919eb4306ff0007bf397f",
"type": "Test",
"lastModifiedTime": 1728649707933,
"containerDocument": {
"_id": "670919eb4306ff0007bf397f",
"tenant_id": "78057",
"type": "Test",
"is_deleted": false,
"tag_define_type": "custom",
"describe_api_name": null,
"created_by": "1000",
"last_modified_by": "1000",
"create_time": 1728649707933,
"last_modified_time": 1728649707933,
"tag_range": [
"MarketingKeywordObj",
"EnterpriseInfoObj"
],
"is_all": false,
"api_name": "group_YpkQ3__c",
"is_mutex": null,
"is_active": true,
"group_description": "Solid practical plan"
}
}Code examples
def (String message, Map data, Boolean error) = Fx.tag.createTagGroup(["AccountObj"], "group_ceshi11__c", false, "Test Group Name 123")7. updateTagGroup Modify Tag Group
Modify Tag Group
Fx.tag.updateTagGroup(<String api_name>, <String id>, <List describe_api_names>, <Boolean is_applied_to_all>, <String tag_group_name>)
Request parameters
Request Body
| Parameter Name | Type | Description | Required |
|---|---|---|---|
| api_name | String | Tag group API name | Y |
| id | String | Tag group ID | Y |
| describe_api_names | List[String] | List of applicable objects for this tag group | Y |
| is_applied_to_all | Boolean | Whether applicable to all objects | Y |
| tag_group_name | String | Group name | Y |
Return Parameters
| Parameter Name | object | Description |
|---|---|---|
| Result | object | |
| Value | object |
| Result | object | Description |
|---|---|---|
| FailureCode | integer | |
| StatusCode | integer | |
| UserInfo | object |
| UserInfo | object | Description |
|---|---|---|
| EmployeeID | integer | |
| EnterpriseAccount | string |
| Value | object | Description |
|---|---|---|
| tagDescribe | object |
| tagDescribe | object | Description |
|---|---|---|
| createTime | Integer | Creation time |
| isActive | Boolean | Group status |
| deleted | Boolean | Whether deleted |
| tagRange | List[string] | Applicable object scope |
| isAll | Boolean | Whether applicable to all objects |
| isMutex | Boolean | Whether mutually exclusive |
| apiName | String | Group apiName |
| tagDefineType | String | Tag classification type |
| groupDescription | String | Group description |
| lastModifiedBy | String | Last modified by |
| createdBy | String | Created by |
| tenantId | String | Enterprise ID |
| id | String | Group ID |
| range | Object | Applicable personnel scope |
| type | String | Group name |
| lastModifiedTime | Integer | Last modified time |
Return an example
{
"Result": {
"FailureCode": 0,
"StatusCode": 0,
"UserInfo": {
"EmployeeID": 1000,
"EnterpriseAccount": "74255"
}
},
"Value": {
"tagDescribe": {
"createTime": 1587785957907,
"isActive": true,
"deleted": false,
"tagRange": [
"AccountFinInfoObj"
],
"isAll": false,
"isMutex": false,
"apiName": "ceshi002__c",
"tagDefineType": "custom",
"groupDescription": "Test data description",
"lastModifiedBy": "1000",
"createdBy": "1000",
"tenantId": "74255",
"id": "5ea3b0e5e1a70b0001e2f65b",
"range": {},
"type": "Test data",
"lastModifiedTime": 1728565061702
}
}
}Code examples
def(String message, Map data, Boolean error) = Fx.tag.updateTagGroup("group_ceshi11__c", "624272c1babe24000101d2e5", [], true, "Change test name")
ifNotice
- Restrictions on parameter api_name: (1) Cannot be empty, (2) Cannot be modified
- Parameter tag_group_name: (1) Cannot be empty, (2) Length cannot exceed 10 characters
8. deleteTagGroup Delete Tag Group
Delete Tag Group
Fx.tag.deleteTagGroup(<String api_name>, <String id>)
Request parameters
Request Body
| Parameter Name | object | Description | Required |
|---|---|---|---|
| api_name | String | Tag group API name | Y |
| id | String | Tag group ID | Y |
Code examples
def(String message, Map data, Boolean error) = Fx.tag.deleteTagGroup("624272c1babe24000101d2e5")9. enableTag Enable tags
Enable Tags
Fx.tag.enableTag(<String tag_group_id>, <String tag_group_api_name>, <String tag_id>, <String tag_api_name>)
Request parameters
Request Body
| Parameter Name | object | Description | Required |
|---|---|---|---|
| tag_group_id | String | Tag group ID | Y |
| tag_group_api_name | String | Tag group API name | Y |
| tag_id | String | Tag ID | Y |
| tag_api_name | String | Tag API name | Y |
Code examples
def result = Fx.tag.enableTag("tag_scDwW__c", "group_ceshi11__c", "62427820babe24000101d80d", "6242784d06e1bf00015f33ec")10. disableTag Disable tag
Disabled Tags
Fx.tag.disableTag(<string tag_group_id>, <string tag_group_api_name>, <string tag_id>, <string tag_api_name>)
Request parameters
Request Body
| Parameter Name | object | Description | Required |
|---|---|---|---|
| tag_group_id | string | Y | |
| tag_group_api_name | string | Y | |
| tag_id | string | Y | |
| tag_api_name | string | Y |
Code examples
def result = Fx.tag.disableTag("tag_scDwW__c", "group_ceshi11__c", "62427820babe24000101d80d", "6242784d06e1bf00015f33ec")11. deleteTag Delete Tag
Delete Tag
Fx.tag.deleteTag(<String tag_group_id>, <String tag_group_api_name>, <String tag_id>, <String tag_api_name>)
Request parameters
Request Body
| Parameter Name | Type | Description | Required |
|---|---|---|---|
| tag_group_id | String | Tag group ID | Y |
| tag_group_api_name | String | Tag group API name | Y |
| tag_id | String | Tag ID | Y |
| tag_api_name | String | Tag API name | Y |
Code examples
def result = Fx.tag.deleteTag("tag_scDwW__c", "group_ceshi11__c", "62427820babe24000101d80d", "6242784d06e1bf00015f33ec")12. findTagGroup Retrieve tag groups and their applicable objects based on apiName
Retrieve tag groups and their applicable objects by apiName
Fx.tag.findTagGroup(<String group_api_name>)
Request parameters
Request Body
| Parameter Name | Type | Description | Required |
|---|---|---|---|
| group_api_name | String | Tag group API name | Y |
Return Parameters
| Parameter Name | Type | Description |
|---|---|---|
| name | String | Group name |
| apiNameList | List[string] | Applicable object scope |
| isAppliedToAll | Boolean | Whether to apply to all objects |
| tagGroupId | String | Tag group ID |
Return an example
{
"name":"Group Name",
"apiNameList":["AccountObj"],
"isAppliedToAll":true,
"tagGroupId":"5e981b91ee56e5446723dd1e"
}Code examples
def (String message, Map data, Boolean error) = Fx.tag.findTagGroup("group_ceshi11__c")13. findTagByTagIds Batch query tag descriptions by tag IDs
Batch query tag descriptions by tag IDs
Fx.tag.findTagByTagIds(<array apiNames>)
Request parameters
Request Body
| Parameter Name | Type | Description | Required |
|---|---|---|---|
| apiNames | array[string] | Y |
Return Parameters
| Parameter Name | APIResult | Description |
|---|---|---|
| isError | boolean | Indicates whether an error occurred |
| data | object | Response data |
| message | string | Status message |
| data | object | Response data |
|---|---|---|
| tagList | array[object] | Data list returned |
| tagList | object | Tag description |
|---|---|---|
| last_modified_time | number | Last modified timestamp |
| is_active | boolean | Whether the tag is active |
| create_time | number | Creation timestamp |
| tag_group_id | string | Tag group ID |
| name | string | Tag name |
| description | string | Tag description |
| tag_api_name | string | Tag API name |
| id | string | Tag ID |
| create_user | string | Creator username |
Return an example
{
"isError": false,
"data": {
"tagList": [
{
"last_modified_time": 1723431673765,
"is_active": true,
"create_time": 1588770951196,
"tag_group_id": "5ea3b0e5e1a70b0001e2f65b",
"name": "Test 222222",
"description": "",
"tag_api_name": "label_ntys8__c",
"id": "5eb2b887d653e40001369112",
"create_user": "1000"
},
{
"last_modified_time": 1722323037015,
"is_active": false,
"create_time": 1606540721016,
"tag_group_id": "5fc1dd880680680001fc1900",
"name": "Shanghai Campaign",
"description": "",
"tag_api_name": "tag_nyMWk__c",
"id": "5fc1ddb10680680001fc1906",
"create_user": "1000"
}
]
},
"message": ""
}Code examples
List tagIds = ["5fc1dd990680680001fc1903"]
def(Boolean error, Map data, String message) = Fx.tag.findTagByTagIds(tagIds)
if (error) {
log.info("error:" + message)
}
log.info(data)Reference object com.fxiaoke.functions.model.QueryResult
Reference object com.fxiaoke.functions.model.TagArg
Field description
| Parameter Name | object | Description |
|---|---|---|
| tagId | java.lang.String | Tag ID |
| tagApiName | java.lang.String | Tag API name |
| groupApiName | java.lang.String | Optional parameter |
| groupId | java.lang.String | Tag group ID |
| description | java.lang.String | Description |
| tagName | java.lang.String | Tag name |
