Choose where you’d like to start

Focus

Note: This task is applicable only to Zoho Creator.

Overview

In a form, the focus (the insertion pointer or cursor) can be positioned on any required field using the Focus task either while loading the form or during user input in the form events.

Once the user starts filling in the form, the focus can be moved from one field to another required field. Likewise, a form can have multiple focus tasks, which ensures quick and efficient data entry.

Syntax

To focus a form field in a main form workflow

focus <field_link_name>;

 

To focus any field in a row in subform field's workflow

focus row.<subform_field_link_name>;
 
ParamExplanation
<field_link_name> & <subform_field_link_name>

Link name of the field that needs to be focused.

Points to keep in mind for this parameter:

  • Only one field can be focused at a time.
  • If multiple focus tasks are configured consecutively, then the cursor will be placed on the field of the last focus task.
  • To focus a subfield in a composite field, specify the subfield along with the main field. For example: focus Name.prefix;
  • You cannot focus a field in the main form from a subform workflow and vice versa.
  • From the main form workflow, a subform can be focused but its field cannot be focused. During the 'On Edit - On Load' workflow event, if the subform contains records, the focus will be set on the first field in the first row.
  • A lookup field can be focused, but the field in the looked-up form cannot be focused.
  • An integration field can be focused, but the fields that belong to the integrated services cannot be focused.

Unsupported Field Types

This task is only applicable for the fields that collect data from the application users. 
Focus cannot be used for the below fields:

FormulaAuto numberBlueprintNotes
Section FieldAI fields like PredictionStateless form buttonsSystem fields (eg: Added Time and ID)

This task can be used in the following events

When a record is Created

Workflow eventFor form fieldsFor subform fields
On LoadYesNo
On ValidateNoNo
On SuccessNoNo
On User inputYesNo
On user input of a subform fieldNoYes
Subform on add rowNoYes
Subform on delete rowNoNo

When a record is Created or Edited

Workflow eventFor form fieldsFor subform fields
On LoadYesNo
On ValidateNoNo
On SuccessNoNo
On User inputYesNo
On user input of a subform fieldNoYes
Subform on add rowNoYes
Subform on delete rowNoNo

When a record is Edited

Workflow eventFor form fieldsFor subform fields
On LoadYesNo
On ValidateNoNo
On SuccessNoNo
On User inputYesNo
On user input of a subform fieldNoYes
On UpdateNoNo
Subform on add rowNoYes
Subform on delete rowNoNo

When a record is Deleted

Workflow eventFor form fieldsFor subform fields
On ValidateNoNo
On SuccessNoNo

Other workflow events

Workflow eventFor form fieldsFor subform fields
On a scheduled dateNoNo
During approval processNoNo
During payment processNoNo
In a Custom FunctionNoNo
In an Action item in reportNoNo
In a Stateless form button-clickNoNo

Example 1

  • When a form loads, the focus can be applied to the first field in the form. This ensures that the cursor is placed automatically on the first relevant field for immediate input, once the user opens the form.
focus Name;            

Example 2

  • Let's say there is a subform for entering payment details, which has a dropdown to select the payment mode. When the user chooses "Card" option as the payment mode, the cursor can be automatically shifted to the "Card Number" field for a better user experience.

    Note: Since this is written in a subform workflow, the keyword "row" has to be used to refer the subform field.
if(Payment_Mode == "Card") 
 { 
    focus row.Card_Number; 
  }               

Example 3: Data entry through scanner

  • Consider an accounting department that uses scanners to input their stack of invoices. As each invoice is scanned, the focus task can automatically position the cursor in the relevant field, such as the invoice number. Users can quickly confirm or edit the extracted data before moving on to the next scanned invoice.
if(<condition>) 
 { 
    focus invoice; 
  } 
else 
 { 
    focus next_field; 
  } 
                                                                                                                                                                                

See How It Works

  • Let's consider a scenario in a retail environment, where a web-based barcode scanner is being used to process inventory. Assume that you've built an application named Inventory Management in which the scanned data is stored. Earlier, you'd have manually typed the product details into a subform, one by one. Using the focus task, after the completion of every scan, you can configure a workflow to automatically set the focus on the desired input field for the next scan. This eliminates the need to manually select the required field between each scan.

Get Started Now

Execute