Accessing subform fields in client actions using "row"
Table of Contents
Note: This feature is applicable only to Zoho Creator.
Overview
The fields of a subForm row can be accessed in Deluge during client actions. This is effected through the row keyword which acts as a handle to the fields in a subForm row.
Note:
- By default, the row represents the handle to a subForm row's fields on which a client action is being performed.
- At any given point of time, row can point to only one subForm row.
- row is similar to input, except that its scope is restricted to the client actions on a subForm row. Composite fields in a subform row are accessed
Syntax
To fetch the value of a subForm row's field.
<variable>=row.<subForm_field_link_name>;
To set the value of a subForm row's field.
row.<subForm_field_link_name>=<value>;
Param | Description |
---|---|
<subForm_field_link_name> | Link name of the subForm field whose value needs to be retrieved or set. |
<variable> | The variable which will hold the value of the desired field from a subform row. |
<value> | The value that should be assigned to the desired field in a subform row. This can be of any data type. |
This task can be used in the following events
When a record is Created | ||
On Load | Yes | |
On Validate | No | |
On Success | No | |
On User input | Yes | |
Subform on add row | Yes | |
Subform on delete row | Yes | |
When a record is Created or Edited | ||
On Load | Yes | |
On Validate | No | |
On Success | No | |
On User input | Yes | |
Subform on add row | Yes | |
Subform on delete row | Yes | |
When a record is Edited | ||
On Load | Yes | |
On Validate | No | |
On Success | No | |
On User input | Yes | |
On Update | Yes | |
Subform on add row | Yes | |
Subform on delete row | Yes | |
When a record is Deleted | ||
On Validate | No | |
On Success | No | |
Other workflow events | ||
On a scheduled date | No | |
During approval process | No | |
During payment process | No | |
In a Custom Function | No | |
In an Action item in report | No |
Example
Imagine a subform with an email field. The following snippet retrieves the email address in a subForm record on a client action (like On Load) and assigns it to another variable.
if(row.mail!=null) { emailId = row.mail; // the email from the field in the subForm row is now retrieved }
Imagine a field age and a concession field which tracks whether a person is eligible for it. The following snippet sets the concession eligibility field to yes if the age of the passenger is greater than 60 years on a client action (like On User Input).
if(row.Age!=null) { row.concession = "yes"; // the passenger is now made eligible for a concession }
Accessing composite fields in a subform using "row"
- When using with the Name or Address fields, it is mandatory to specify the subfields. When using the country subfield, the value must be one of the applicable countries in the field's properties. Otherwise, the specified value is not considered.
- When using with the Users field, you can specify the User_name and email subfields. Or you can directly specify the Users field without the subfields, in which case the User_name subfield is taken by default. However, the value specified is considered, or is taken to be true, only when the value pertains to an actual user. Please note that when using the User_name subfield, the username of the user has to be specified, and when using the email subfield, the email of the user has to be specified for it to work.
- The URL field will work when the value is specified in a HTML format like the following:
<a href= \"<URL>\" title = \"<TITLE>\" target = \"_blank\"><linkname></a>
where: title, link name and target are optional params
For examplerow.URL = <a href= "https://www.zoho.com" title = "Zoho webpage" target = "_blank">zoho</a>