Choose where you’d like to start

Update record

Note: This task is applicable only to Zoho Creator.

Overview

The update record deluge task updates(replaces) the value of a specified field with the given value.

Record needs to be fetched before they can be updated.

Syntax

To update a field value in the first record in the collection variable:

<collection_variable>.<field_link_name> = <expression>;

To update a field value in every record in a collection:

for each <loop_variable> in <collection_variable>;
{
<loop_variable>.<field_link_name> = <expression>;

}
ParameterDescription
<collection_variable>Collection variable holding the collection of records.
<field_link_name>

Link name of the field whose value will be updated.

  • Mandatory fields cannot be updated with null value.
  • Signature, Subform, and Add Notes field types cannot be specified.
  • Auto Number field type, Formula field type, and system fields such as Added Time, Added location, Added IP Address, Modified Time, Modified location, ID, and Modified IP Address system fields should not be specified. Zoho Creator will set values for them automatically.
<expression>

Value to be assigned to the field. You can directly specify a value, or you can specify an expression, i.e. a combination of values, constants, variables, operators, functions and so on, which evaluates to a value.

Refer this document to know the data-type of values each field type can hold.

<loop_variable>

Variable to hold an individual record for each iteration.

You can specify any variable name here, without having to declare it initially.

It is advisable to not use the same loop variable used earlier.

 

Applicable data-type and expression for each field

Field typeData-typePoints to note
NameText

You must specify only the link name of the "Name" field when assigning it a value copied from another "Name" field.

In all other cases, you have to give the values for its sub-fields separately as given below:

<field>.prefix: denotes the "prefix" field.

<field>.first_name: denotes the "first_name" field.

<field>.last_name: denotes the "last_name" field.

<field>.suffix: denotes the "suffix" field.

Note:

  • If more than one Name fields are present in the form, the link names of the subsequent name sub fields will be appended by a number starting from 1. So, if we take the example of the subfield <field>.prefix, the link name of the first such field will be <field>.prefix, the link name of the second such field will be <field>.prefix1, the link name of the third such field will be <field>.prefix2, and so on. 
EmailText

The format of the specified email address must be valid. If the format of the specified email address is invalid, execution will be stopped during runtime.

The number of characters in the value should not exceed the length specified in the "Character maximum" field property. If it exceeds, execution will be stopped during run-time.

AddressText

You must specify only the link name of the "Address" field when assigning it a value copied from another "Address" field.

In all other cases, you have to give values for its sub-fields separately as given below:

<field>.address_line_1: denotes the "Address Line 1" field.

<field>.address_line_2: denotes the "Address Line 2" field.

<field>.district_city: denotes the "City / District" field.

<field>.state_province: denotes the "State / Province" field.

<field>.postal_Code: denotes the "Postal Code" field.

<field>.country: denotes the "Country" field.

<field>.longitude: denotes the "longitude" field.

<field>.latitude: denotes the "latitude" field.

Note:

  • If more than one address fields are present in the form, the link names of the subsequent address sub fields will be appended by a number starting from 1. So, if we take the example of the subfield <field>.country, the link name of the first such field will be <field>.country, the link name of the second such field will be <field>.country1, the link name of the third such field will be <field>.country2, and so on. 
PhoneText

Value can be specified with or without the country code, even if the "Country code options" and "Default country code" field properties are not selected.

Special characters like (), and - are supported to accept different phone number formats of various countries.

Single LineTextThe number of characters in the value should not exceed the length specified in the "Character maximum" field property. If it exceeds, execution will be stopped during run-time.
Multi LineTextThe value can be plain text of maximum 64 kb size.
NumberNumberIf the number of digits specified in the value exceeds the length specified in the "Max Digits" field property, the extra digits will be trimmed from the right.
DateDate-time

All days in a week can be specified as value, irrespective of the selected days in "Allowed Days" property.

Time value, if specified, will not get added.

Drop DownText

You can specify a new choice apart from pre-defined choices even if the "Allow Other Choice" field property is not selected.

If a new choice is specified as the value, it only gets saved in the record and is not added as a new choice to be selected from the form UI. And that choice cannot be retrieved back if modified.

RadioText

You can specify a new choice apart from existing choices even if the "Allow Other Choice" field property is not selected.

If a new choice is specified as the value, it only gets saved in the record and is not added as a new choice to be selected from the form UI. And that choice cannot be retrieved back if modified.

Multi SelectText list

You can specify a new choice apart from the pre-defined choices.

If a new choice is specified as the value, it only gets saved in the record and is not added as a new choice to be selected from the form UI. And that choice cannot be retrieved back if modified.

CheckboxText list

You can specify a new choice apart from the pre-defined choices.

If a new choice is specified as the value, it only gets saved in the record and is not added as a new choice to be selected from the form UI. And that choice cannot be retrieved back if modified.

Decision boxBoolean

You can specify the value as True or False, with or without double quotes.

If any other value is specified, execution will be stopped during run time.

Rich TextTextThere is no limit to the number or type of characters that can be specified as the value.
UrlText
  • HTML text format: <a href= \"<URL>\" title = \"<TITLE>\" target = \"_blank\"><linkname></a> 
    where: title, link name and target are optional params
  • Plain text format: URL as such can be provided as a text enclosed with double quotes.
Note: Plain text format can be used only in the "On success", "On create", "On edit", and "On create or edit" workflow events.
ImageText

Value must be specified in the following format (title, linkname and target are optional params) :  

<a href= \"http://<LINKNAME>\" title =\"<TITLE>\" target = \"_blank\"><img src = \"<URL>\" title =\"<TITLE>\"></img></a> 

You must specify the image url as the value, even if the "Browse Options -Link" field property is not selected. 

The link must be that of a public image.

PercentDecimal

If the number of digits specified in the value exceeds the length specified in the "Max Digits" field property, the extra digits will be trimmed from the right.

If the specified decimal points exceed the number specified in "Decimal Points" field property, the extra decimal points will be trimmed from the right. 

CurrencyDecimal

If the number of digits specified in the value exceeds the value specified in the "Max Digits" field property, the extra digits will be trimmed from the right.

If the specified decimal points exceed the number specified in "Decimal Points" field property, the extra decimal points will be trimmed from the right. 

DecimalDecimal

If the number of digits specified in the value exceeds the value specified in the "Max Digits" field property, the extra digits will be trimmed from the right.

If the specified decimal points exceed the number specified in "Decimal Points" field property, the extra decimal points will be trimmed from the right.

Date-TimeDate-time

All days and hours can be specified as value, irrespective of the selected days and hours in "Allowed Days" and "Allowed Hours" property. 

If Time value is not specified, 00:00:00 will be set as the time value.

Lookup

(Display type - Dropdown/Radio Button)

NumberYou must specify the record ID of the lookup form as the value. 

Lookup

(Display type - Multi Select/Checkbox)

Number listYou must specify the record ID of the lookup form as the value.
File UploadFile UploadOnly a file value fetched from another File Upload field type should be specified as a value.
AudioAudioOnly an audio file value fetched from another Audio field type should be specified as a value.
VideoVideoOnly a video file value fetched from another Video field type should be specified as a value.
UsersText

You can specify username of any user or developer added in your current app. 

You can view the list of users and developers in your account by navigating to Settings > Users. From this page, you can also add more users and developers to your account.

If you enter an incorrect username, execution will be stopped during run-time.

Integration (Zoho CRM)Text

You must specify the record ID in the selected module as the value. I

f you enter an incorrect ID, execution will be stopped during run-time.  

Learn how to fetch the ID of a record after creating it or fetching it.

Integration (Zoho Recruit)Text

You must specify the record ID in the selected module as the value.

If you enter an incorrect ID, execution will be stopped during run-time.

Learn how to fetch the ID of a record after creating it or fetching it.

Integration (Salesforce)Text

You must specify the record ID in the selected module as the value.

If you enter an incorrect ID, execution will be stopped during run-time.

Learn how to fetch the ID of a record after creating it or fetching it.

Integration (Zoho Books)Text

You must specify the record ID in the selected module as the value.

If you enter an incorrect ID, execution will be stopped during run-time.

Learn how to fetch the ID of a record after creating it or fetching it.

Integration (Quickbooks)Text

You must specify the record ID in the selected module as the value.

If you enter an incorrect ID, execution will be stopped during run-time.

Learn how to fetch the ID of a record after creating it or fetching it.

Things to keep in mind

  • While using the first syntax, if the collection variable holds multiple records, the field value in the first added record only will updated.

This task can be used in the following events

When a record is Created
On LoadYes
On ValidateYes
On SuccessYes
On User inputYes
Subform on add rowYes
Subform on delete rowYes
When a record is Created or Edited
On LoadYes
On ValidateYes
On SuccessYes
On User inputYes
Subform on add rowYes
Subform on delete rowYes
When a record is Edited
On LoadYes
On ValidateYes
On SuccessYes
On User inputYes
Subform on add rowYes
Subform on delete rowYes
When a record is Deleted
On ValidateYes
On SuccessYes
Other workflow events
On a scheduled dateYes
During approval processYes
During payment processYes
In a Custom FunctionYes
In an Action item in reportYes

Example

The following script fetches record with "Employee ID" field value as 9021, and updates the "Name" field value to "Harry John".

EmployeeDetails = Employees [ Employee_ID == 9021 ];
EmployeeDetails.Name.first_name = "Harry" ;

Get Started Now

Execute