Choose where you’d like to start

Count

Note:

  • This task is applicable only to Zoho Creator.

Overview

The count function in the "aggregate records" deluge task returns the count of values(including empty strings) a specified field holds, from records fetched using a criteria.

String field types (except Users, Name, Address, and Integration) and the Radio field type, if saved without a value are stored with an empty string, and hence will return the count of the empty strings as well.

The Name and Address fields must be specified without its subfields.

Multi Select, Dropdown, Radio, and Checkbox field types will return the count of selected choices.

When the field is not specified, it simply returns the count of fetched records.

The criteria is mandatory.

Return

The data-type of the returned value is Number.

Syntax

<variable> = <form_link_name> [<criteria>].count(<field_link_name>);

ParameterDescription
<variable>Variable which will hold the returned value.
<form_link_name>

Link name of the form from which the records will be fetched.

<criteria>

Criteria based on which the records will be fetched.

count(<field_link_name>)

Link name of the field to which the count function will be applied.

This function can be applied to any Zoho Creator field type.

The <field_link_name> param is optional.

Things to keep in mind

  • If you wish to fetch all records of the specified form, use the following script as criteria:
    [id != 0]

    It is advisable to fetch all records only when absolutely needed. Fetching all records generates a load resulting in performance issues.

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 returns the count of values of "phone number" field from the Employees form.

EmployeeDetails = Employees [ ID != 0 ].count(phone_number);

Get Started Now

Execute