Choose where you’d like to start

Distinct

Note:

  • This task is applicable only to Zoho Creator.

Overview

The distinct function in the "aggregate records" deluge task returns a list of unique values of a specified field from records fetched using a criteria.

The criteria is mandatory.

This function can be applied to all field types.

Return

The data-type of the returned value is List.

Syntax

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

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

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

<criteria>

Criteria based on which records will be fetched.

distinct(<field_link_name>)

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

This function can be applied to all field types.

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 list of different values of "age" field from the Employees form.

EmployeeDetails = Employees [ ID != 0 ].distinct(age);

Get Started Now

Execute