Criteria in Import Picklist Data



 

Description

 

By default, a picklist field of type "Import Data from form", will display all the values of the imported field. To set a picklist to display only specific values from the imported field, you can specify the required criteria and display only those values that satisfy the criteria.

 

Syntax

 

 

<picklist fieldname>
(
type = picklist
values = <form name>[criteria].<fieldname to be imported from form name>
)

 

Note:

You cannot import a picklist field, in another form. You can only import a textfield as a picklist in another form.

 

Example

 

Assume a form named FormA has two fields "Country" and "State" to enter the name of a country and its states. The FormA view is given below:

 

 

Now, you want to create another form named "FormB", that has the field "IndianStates" of type picklist that needs to import only the names of the states that belongs to the country "India" from FormA. The deluge script to do this is given below:

 

Deluge code:

 

form  FormB
{
    
    IndianStates
    (
        type  =  picklist
        values  =  FormA[Country == "India"].State
    )

}

 

where the expression,

 

FormA[Country == "India"].State - Fetches only the "State" values from "FormA" whose "Country"is "India".

 

The FormB given below displays only the names of the States belonging to the country "India".

 

 

 

 

Related Topics

 

Add to Picklist Dynamically

Clear Picklist