Create Field Update
Field Update actions allow you to update values of specified fields when the associated Workflow Rules, Blueprints, or Approval Processes are executed.
Purpose
To create a field update action in the Automation module. This action modifies field values when triggered by workflows, blueprints, or approval processes.
Endpoints
- POST /settings/automation/field_updates
Request Details
Request URL
{api-domain}/crm/{version}/settings/automation/field_updates
Header
Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
Supported modules
Leads, Accounts, Contacts, Deals, Campaigns, Tasks, Cases, Events, Solutions, Products, Vendors, Price Books, Quotes, Sales Orders, Purchase Orders, Invoices, Custom, Appointments, Appointments Rescheduled History, and Services.
Scope
ZohoCRM.settings.automation_actions.CREATE
Sample Request
Copiedcurl "https://www.zohoapis.com/crm/v8/settings/automation/field_updates"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-d "@fieldUpdate.json"
-X POST
Input JSON
- field_updatesJSON array, mandatory
Contains the data to create a field update action.
- moduleJSON object, mandatory
Specify the module where the field update should be applied. Use the Get Modules Metadata API to retrieve module API names and unique fields.
- typestring, mandatory
Specify the type of field update.
Possible values :
static : A fixed value is set.
- feature_typestring, optional
Specify the automation feature in which you want to use the field update.
Possible values : workflow
- fieldJSON object, mandatory
Specify the API name and the unique ID of the field to be updated. Use the Get Fields Metadata API to get valid field data. Please note that the "id" of the field is mandatory.
- namestring, mandatory
Specify the name of the field update action.
- valuestring, mandatory
Specify the value to set in the specified field.
Note
- For single-value fields, use a string for "value".
- For multi-select and multi-user fields types, use an array for "value". For example, (["Call", "Advertisement"]).
- update_typestring, mandatory for multi-select and multi-user fields
Specify how to update the field. This key is supported only for the multi-select fields.
Possible values:- overwrite : Replace existing values with the new ones.
- append : Add new values to the existing ones.
- dependent_fieldsJSON object
Specify the dependent fields that are affected when the target field is updated. This is primarily used in picklist dependencies, where the value of one field controls the valid options in another field.
Example : If you update the Country field to India, the dependent field State will automatically be restricted to Indian states only.
Note
A maximum of one field update can be created per API call.
Sample Input
Copied{
"field_updates": [
{
"module": {
"api_name": "Leads",
"id": "5725767000000002175"
},
"type": "static",
"feature_type": "workflow",
"field": {
"api_name": "Company",
"id": "5725767000000002591"
},
"name": "ZOHOLICS",
"value": "ZoHo"
}
]
}
Sample input to create a field update using a multi-select picklist field
Copied{
"field_updates": [
{
"module": {
"api_name": "Leads",
"id": "5725767000000002175"
},
"field": {
"id": "5725767000007121008",
"api_name": "Languages_Known"
},
"type": "static",
"name": "ZOHOLICS",
"value": [
"English",
"Spanish",
"Hindi"
],
"update_type": "append"
}
]
}
Possible Errors
- INVALID_DATAHTTP 400
The module details given in the "module" JSON object seems to be invalid
Resolution: Specify valid module details in the request. Refer to Get Modules Metadata API to retrieve module details.
The field details given in the "field" JSON object seems to be invalid
Resolution: Specify valid field details in the request. Refer to Get Fields Metadata API to retrieve module details.
- NOT_ALLOWEDHTTP 400One or more unsupported keys are mentioned in the inputResolution: The "apply_assignment_threshold" and "notify" are not allowed in creating field updates. Try API call without these keys.
- MANDATORY_NOT_FOUNDHTTP 400
One or more mandatory keys are missing
Resolution: Make sure all mandatory keys are included. Refer to the Input JSON section for the list of mandatory fields. - DEPENDENT_FIELD_MISSINGHTTP 400
One or more dependent fields are missing
Resolution: Specify the dependent fields in your input. Refer to the Input JSON section for details. - INVALID_REQUEST_METHODHTTP 400
The http request method type is not a valid one
Resolution: You have specified an invalid HTTP method to access the API URL. Specify a valid request method. Refer to the Endpoints section above. - OAUTH_SCOPE_MISMATCHHTTP 401
Unauthorized
Resolution: The client does not have a valid scope to create the field update. Create a new token with valid scope. Refer to Scope section section. - AUTHENTICATION_FAILUREHTTP 401
Authentication failed
Resolution: Pass the access token in the request header of the API call. - INVALID_URL_PATTERNHTTP 404
Please check if the URL trying to access is a correct one
Resolution: The request URL specified is incorrect. Specify a valid request URL. Refer to Request URL section for details. - INTERNAL_ERRORHTTP 500
Internal Server Error
Resolution: Unexpected and unhandled exception in the server. Contact support team.
Sample Response
Copied{
"field_updates": [
{
"code": "SUCCESS",
"details": {
"id": "5725767000006953001"
},
"message": "fieldupdate created successfully",
"status": "success"
}
]
}