Guided Workflow Screen Components - Picklist Input

Updated 

 

A picklist is an input field that enables users to select a predefined option from a drop-down menu. It is commonly used within workflows to represent specific actions or states, aiding in tasks such as information gathering, decision-making, and process automation.

Key applications of picklists include:

  • Assigning tasks to team members

  • Setting the status of a task or project

Picklists can be defined in five ways:

  1. Manual: You can annually add and manage picklist values within the system.

  2. Via API: You can integrate external systems to populate picklist options automatically.

  3. By Variable: You can customize options with a defined format for dynamic selection.

  4. Custom Field: You can define the custom picklist values specific to the field.

  5. By Entity Type: You can define the picklist options based on specific entity types.

Additionally, picklists can be configured to adapt their responses to align with the user interface (UI), ensuring a seamless and intuitive experience.

Various Fields in Picklist Input

Note: You can hover over the info icon next to each field for a description.

  • API Name: The API Name is a unique identifier used to reference a particular object, field, or component in an application programmatically. It is typically used in backend code, integrations, or API calls. API Names are often system-generated and follow a specific naming convention, such as using underscores instead of spaces (e.g., Customer_Status__c). 

  • Label: You can define the heading of the field to be displayed during runtime. The label can be used to provide intuitive guidance to the end user, clearly indicating what input value is expected in the field. You can also configure the label dynamically using the Resource Selector.

  • Mark Field as Mandatory to mark the field mandatory. If the field is not filled, it will not allow the user to move to the next step. 

  • Add Help Text: You can enable this toggle to add the help text for the user.

  • Placeholder: It specifies the name of the field displayed in the system. 

  • The default value is the preset value used when the end user fills in nothing. 

  • Entity Type: You can select any standard or custom entity.

  • Choose Controlling Field: You can choose the primary pick list based on which the current pick list values will be displayed.

    • Example: Suppose you are designing a guided workflow for case creation, and you want to display a list of states based on the country selected by the agent. In this scenario: 

      • The country is the controlling field. 

      • The state is the dependent field. 

    • How it works: 

      • When the agent selects a value in the "Country" field (e.g., "United States"), the "State" field dynamically updates to show only the states relevant to that country (e.g., California, Texas, New York). 

    • Retain field value on changes to Controlling Field: The Retain field value on changes to Controlling Field option enables interdependent behavior between related picklists. When this option is enabled, Guided Workflow preserves previously selected values if they remain valid after a controlling field changes. If a selected value is no longer valid based on the updated dependency, it is automatically cleared. This allows users to start their selection from any related field instead of following a fixed top-down order. Refer to the following example:

      • Consider three dependent picklists:

        • Department

        • Zone

        • Agent

      • The dependencies are configured as follows:

        • Department D1 contains Zones Z1–Z5

        • Zone Z3 contains Agent A5

      • With Retain field value on changes to Controlling Field enabled:

        • If a user first selects Agent A5, Guided Workflow automatically identifies the associated Zone (Z3) and Department (D1).

        • If the user later changes another related field, the existing selections are retained as long as they remain valid.

        • If a change results in an invalid combination (for example, selecting a department that does not contain Zone Z3), the incompatible field values are automatically cleared.

    • Filter Records: You can apply a filter based on the fields available in the entity. You can apply multiple filters by clicking + Add Condition and applying And/Or logic.

    • Sort Record By: This field allows you to control how values in the Pick List are ordered on the UI.

    • Label Field: In the Label field, you can specify the text that should be displayed to the user, such as the airline name.

    • Contains Duplicate: Enable if the entity data contains duplicate records to ensure unique fields are shown in the pick list.

    • Value Field: In the corresponding Value field, you can use the airline’s ID as the backend value, since the system may store and process the airline using its ID instead of the name. This way, users will see the airline's name in the dropdown, while the backend operates with the airline's ID.

    • Sort Order: You can choose if you want to sort the order in ascending or descending order from the dropdown.

    • Default Value: You can configure the pre-populated value for the component. You can choose a variable here or write the custom code.

    • Multivalued: If you enable this checkbox, the user can select more than one option in the pick list. If there are 3 options in the dropdown, the user can select multiple of them.

      • Enable Custom Validation: By enabling this toggle, you can configure custom validations for Screen input components to display dynamic error messages directly on the screen. Once you enable this toggle, you need to configure the following fields:

        • Validation Logic:

          Enter a custom script to validate the field. You can also use variables (including API response values). If the Groovy script/condition evaluates to Boolean

          , the validation fails, and the configured error message is displayed.

        • Error Message: A configurable dynamic message that is shown when the validation fails.

        • Validate on Screen Load: If you enable this checkbox, it allows validations to run as soon as the screen loads, instead of only on screen submission.

      • Add on Select: Enabling the Add on Select Action toggle enhances user interaction in Guided Workflows by enabling automatic actions based on selection inputs. You can choose one of the following options:

        • Next Screen Action: If you configure the Next Screen Action under Add-on Select, the workflow will automatically navigate to the next screen as soon as you provide an input, eliminating the need for an extra click.

        • Back Screen Action: If you choose Back Screen Action, the input will trigger a return to the previous screen. This feature helps streamline the user journey by reducing manual navigation and improving efficiency.

      • Enable Reporting: Toggle this on to include the values of this screen component in reporting

      • Input Disability Condition: A rule or set of criteria that determines whether a specific element, such as a field, button, or component, should be disabled (i.e., grayed out and non-interactive) in a user interface. It restricts user interaction based on certain conditions, ensuring that actions are contextually valid or preventing errors. 

        • Example: 

          • Based on Field Value

            • Condition: Disable the "Submit" button if the "Terms and Conditions" checkbox is unchecked. 

            • Result: The user cannot submit the form until they accept the terms. 

          • Based on User Role

            • Condition: Disable the "Delete Record" button for users without "Admin" permissions.

            • Result: Only admins can delete records, while other users see the button but cannot interact with it. 

          • Based on Data Completeness

            • Condition: Disable the "Next" button until all required fields are filled. 

            • Result: Users are prevented from moving forward until they complete the required steps.

      • Visibility Conditions: A rule or set of rules that determine whether a specific element, field, or component is visible to users in an application or interface. These conditions are typically based on factors such as user roles, permissions, field values, or contextual data. Visibility conditions ensure that users only see relevant information, improving usability and security. 

        • Example  

          • Condition: Display a "Priority Escalation" section if the "Ticket Priority" is set to "High." 

          • Implementation: Visibility Condition: Ticket_Priority = 'High'.

          • Result: The "Priority Escalation" section appears only for high-priority tickets. 

      • Configure Error Message: This field allows you to create a global error message for users when they keep the field empty.More

Manual

You can manually add fields to the picklist options. 

By API

Picklist by API will be used when you have data coming from an API and you want to display the information in a picklist.

 

  • Service Name: You can select the API value from the dropdown. Once you select the desired value, the following fields will show up. Choose the API/extension in this.

  • Choose Controlling Field: You can choose the primary picklist based on which the current picklist values will be displayed.

    • Example: Suppose you are designing a guided workflow for case creation, and you want to display a list of states based on the country selected by the agent. In this scenario: 

      • Country is the controlling field. 

      • State is the dependent field. 

    • How it works: 

      • When the agent selects a value in the "Country" field (e.g., "United States"), the "State" field dynamically updates to show only the states relevant to that country (e.g., California, Texas, New York). 

  • Set Input Variable Mapping: When using an API, you need to provide the required input variables to receive a valid response. Each API has its own specific set of inputs, and these may vary from one API to another. For example:

    • If you select a different API, the expected input parameters will change accordingly.

    • For the selected API, you must supply values for the defined inputs, such as name or email, to get a valid result from the system.

  • Support Pagination: Pagination refers to the method of loading content in segments or "pages" as you scroll through a list. In the context of a pick list, it means initially loading a set number of records (e.g., page one). As you scroll to the end, additional records (page two, and so on) are automatically loaded without refreshing the page, creating a seamless, on-the-go browsing experience. By enabling this toggle, you can specify the number of rows to display per page in the dynamic table. This will be applicable only if pagination is supported in the API. Once you enable this toggle, the following fields also open up:

    • Page Size Key: You can select the page size input field as defined in the brand API to determine the number of records per scroll of the pick list

    • Page Number Key: You can select the page number input field as defined in the brand API to determine the records to be fetched per page number (scroll of the pick list).

    • Search Key: You can select the search input field as defined in the brand API to allow for searching of items in the pick list based on API logic.

  • Adapt API Response: You need to update the response adapter in this field. Below is the sample API response adapter:

    def tempList = []; def labelValue = []; if (response != null && response.results) { def accList = response.results; if (accList instanceof Collection) tempList = accList; else tempList.add(accList); for (acc in tempList) { def t = [: ]; if (acc?.name) { t['label'] = acc.name; t['value'] = acc.name; labelValue.add(t); } }; }; labelValue.sort { it.label }; return labelValue;

    Note: Use the response adapter to ensure that the data is modified to be in the form of an array of maps.

  • Value: Values correspond to the data displayed under each respective label. This is a mandatory field for API source.

  • Label: Label represents the column headers. This is a mandatory field for API source.  

  • Default Value: You can configure the pre-populated value for the component. You can choose a variable here or write custom code.

By Variable

Picklist by variable will be utilized when data is sourced from an API. You store the value in a variable and subsequently display the data in a picklist.

  • Choose Variable:

    Here variable can either be selected from the Resource Selector or configured manually. When using the Resource Selector, the variable must follow a specific format—typically an array of maps—where each map includes a

    and an "name" and an "id" (e.g., { "name": "John Doe", "id": "user_123" } ).

    This structure allows the system to correctly identify and process the selected resources.

  • Value: Here, you can define the backend value that will be stored or used in API calls. This is a mandatory field for Variable source.

  • Label: This is the user-facing text that appears in the dropdown menu. You can define what the user will see and select, even though a different backend value may be used differently. This is a mandatory field for Variable source.

Note: The data should be in a specific format when you use a picklist. You need to define the label and value in the Groovy code.

def picklist = [];

def x = response["RESPONSE"]["data"]["courier"];

def temp = [:];

temp["label"] = x["idCardNumber"] ;

temp["value"] = x["idCardNumber"] ;

picklist.add(temp);

return picklist;

In the given example, the labels represent the column headers, while the values correspond to the data displayed under each respective label.

  • Default Value: Whatever be value of the value field of the variable is will be used as the default value here.

Custom Field

This option ensures that you are using the same fields present in the Custom Field (CF). 

Note: For controlling the behaviour of custom fields, use the CF screen component instead of the picklist.

  • Asset Class: You can select the type of custom field from the dropdown. The available options are Profile, Case, and User.

  • Custom Field: The custom field you created in the custom field section populates in the dropdown, allowing you to select the relevant option. These will be populated based on the asset class that you choose in the above field.

  • Default Value: It is the pre-populated value for the component. You can either use a text value or a custom field here.

By Entity Type

You can use the entity available in the Sprinklr environment or add a custom entity that you created to store user inputs. 

  • API Name: A unique identifier used to reference the component programmatically. API names are commonly used in backend logic, integrations, and API calls, and typically follow a system-friendly naming convention (for example, Customer_Status__c).

  • Label: Defines the field heading displayed during runtime. Use the label to provide clear guidance to users about the expected input. You can also configure the label dynamically using the Resource Selector.

  • Mark Field as Mandatory: Enable this option to make the field required. Users cannot proceed to the next step until a value is selected.

  • Add Help Text: Displays additional guidance to help users understand the purpose of the component.

  • Placeholder: Enter instructional text that appears before a value is selected.

  • Options Source: Select the source for pick list values. To populate values from an entity, choose By Entity Type.

  • Entity Type: Select the standard or custom entity that contains the values to display in the pick list.

    Note: When using By Entity Type, the pick list displays all configured values available for the selected entity field, regardless of whether corresponding records currently exist in the entity.

  • Choose Controlling Field: Select another pick list field whose value determines the options displayed in the current pick list.

    Example: If you are creating a case creation workflow:

    • Country acts as the controlling field.
    • State acts as the dependent field.

    When a user selects a country, the State pick list automatically displays only the states associated with that country.

Retain Field Value on Changes to Controlling Field

Enable this option to preserve selected values when a controlling field changes, provided the selections remain valid. If a selection becomes invalid based on the new dependency, it is automatically cleared.

For example, consider three dependent pick lists:

  • Department
  • Zone
  • Agent

Dependencies:

  • Department D1 contains Zones Z1–Z5
  • Zone Z3 contains Agent A5

If a user selects Agent A5, the workflow automatically identifies the associated Zone (Z3) and Department (D1). If subsequent changes maintain a valid relationship, the selections are retained. Invalid selections are automatically removed.

  • Filter Records: Apply filters using fields available within the selected entity. You can add multiple conditions and combine them using AND or OR logic.

  • Label Field: Select the entity field whose value is displayed to users in the pick list.

  • Value Field: Select the entity field that stores the underlying value used by the system.

  • For example, users might see an airline name while the workflow stores the corresponding airline ID.

    Contains Duplicate: Enable this option if the entity contains duplicate records and you want to display only unique values in the pick list.

    Sort Records By: Controls how pick list values are ordered.

    Note: You can sort records using the value selected in the Label Field. Choose Label in the Sort Records By field and select the required sort order.

    Sort Order: Select Ascending or Descending order.

    Default Value: Configure a pre-selected value for the component using either a variable or custom code.

    Multivalued: Enable this option to allow users to select multiple values from the pick list.

Enable Custom Validation

Enable this option to configure custom validation logic and display dynamic error messages.

Validation Logic: Enter a custom script or condition to validate the selected value. Variables, including API response values, can be used. If the validation evaluates to false, the configured error message is displayed.

Error Message: Defines the message shown when validation fails.

Validate on Screen Load: Runs the validation as soon as the screen loads instead of waiting for form submission.


Add on Select

Enable this option to trigger actions automatically when a value is selected.

Available actions:

  • Next Screen Action: Automatically moves the workflow to the next screen after a selection is made.
  • Back Screen Action: Returns the user to the previous screen after the selection.

Note: If a mandatory pick list contains only one available option, the value is automatically selected. However, the workflow does not automatically navigate to the next screen even when Next Screen Action is configured. Users must still click Next to continue.


Enable Reporting: Includes the selected value in workflow reports.

Input Disability Condition

Use this option to disable the component based on specified conditions.

Examples

Based on Field Value

  • Condition: Disable the Submit button until the Terms and Conditions checkbox is selected.
  • Result: Users cannot submit the form until they accept the terms.

Based on User Role

  • Condition: Disable the Delete Record button for non-admin users.
  • Result: Only administrators can perform deletion actions.

Based on Data Completeness

  • Condition: Disable the Next button until all required fields are completed.
  • Result: Users cannot proceed until mandatory information is provided.

Visibility Conditions

Visibility conditions determine when a component is displayed based on predefined criteria such as field values, context, or user inputs.

Example

  • Condition: Display a Priority Escalation section when Ticket Priority is set to High.
  • Visibility Condition: Ticket_Priority = 'High'
  • Result: The section is displayed only for high-priority tickets.

Configure Error Message: Defines the error message displayed when users leave a required field empty.

Other Constant Fields

  • Multivalued: If you enable this checkbox, the user can select more than one option in the picklist. If there are 3 options in the dropdown, the user can select multiple of them.

  • Add on Select: Enabling the Add on Select toggle enhances user interaction in Guided Workflows by enabling automatic actions based on selection inputs. You can choose one of the following options:

    • Next Screen Action: If you configure the Next Screen Action under Add-on Select, the workflow will automatically navigate to the next screen as soon as you provide an input, eliminating the need for an extra click.

    • Back Screen Action: If you choose Back Screen Action, the input will trigger a return to the previous screen. This feature helps streamline the user journey by reducing manual navigation and improving efficiency.

  • Enable Reporting: The Enable Reporting toggle allows users to specify whether the auto-drafted values in the screen component should be included in reporting. When enabled, this ensures that auto-saved data is captured and made available for analytics, addressing gaps in reporting accuracy caused by un-submitted workflows.

  • Configure Error Message: This field allows you to create a warning message for users when they keep the field empty. 

  • Enable Custom Validation: Enables you to configure to configure custom validation logic for the Text Input component. Once enabled, additional fields appear to define the validation condition and the error message displayed when validation fails.

    • Validation Logic: Specify the condition that determines whether the entered value is valid. If it evaluates to false, validation fails and the configured error message is shown.

    • Error Message: Enter the error message to display when the validation condition evaluates to false. This field supports dynamic messaging, enabling you to surface backend-specific validation responses such as duplicate values or invalid credentials.

    • Run Validation on Screen Load: Enable this to evaluate the validation condition when the screen loads, instead of waiting for the user to submit the screen. When this option is enabled,

      • The validation condition is evaluated before the screen loads.

      • The corresponding Text Input fields display error states immediately

      • Users do not need to click *Next* or Submit to view validation errors

  • Controlling Field: A controlling field is a field whose values determine the available options or behavior of another related field (called a dependent field). It acts as the parent in a relationship, influencing what the dependent field displays or how it functions based on its selected value. Example: In a form, the "Country" field is the controlling field, and the "State" field is the dependent field. 

    • If "Country" = USA, the "State" field shows states like California, Texas, and New York

    • If "Country" = India, the "State" field shows states like Maharashtra, Punjab, Kerala

  • Default Value: You can define a pre-populated value for the component.

  • Visibility Conditions: A rule or set of rules that determine whether a specific element, field, or component is visible to users in an application or interface. These conditions are typically based on factors such as user roles, permissions, field values, or contextual data. Visibility conditions ensure that users only see relevant information, improving usability and security. 

    • Example  

      • Condition: Display a "Priority Escalation" section if the "Ticket Priority" is set to "High." 

      • Implementation: Visibility Condition: Ticket_Priority == 'High' 

      • Result: The "Priority Escalation" section appears only for high-priority tickets. 

  •  Input Disability Condition: A rule or set of criteria that determines whether a specific element, such as a field, button, or component, should be disabled (i.e., grayed out and non-interactive) in a user interface. It restricts user interaction based on certain conditions, ensuring that actions are contextually valid or preventing errors. 

    • Example: 

      • Based on Field Value

        • Condition: Disable the "Submit" button if the "Terms and Conditions" checkbox is unchecked. 

        • Result: The user cannot submit the form until they accept the terms. 

      • Based on User Role

        • Condition: Disable the "Delete Record" button for users without "Admin" permissions.

        • Result: Only admins can delete records, while other users see the button but cannot interact with it. 

      • Based on Data Completeness

        • Condition: Disable the "Next" button until all required fields are filled. 

        • Result: Users are prevented from moving forward until they complete the required steps.

Note: For more details regarding the same screen evaluation, refer to Same Screen Evaluation in Picklist.

How to Use a Picklist Variable

For a picklist configured in the format below:

[["value": "val1", "label": "lab1"], ["value": "val2", "label": "lab2"]]

Upon selection of a label, e.g., lab1,

  • screen_name.picklist returns: val1

  • screen_name.picklist_raw returns: [value: val1, label: lab1]

Search Behavior of Picklist Input

The search logic for the Picklist Input (Source: Entity) component ensures consistent and predictable results when users search using multi-word or partial terms.

The search behavior performs:

  • a full-prefix match on the entire search string

  • supports substring matching, allowing users to find results using partial text.

Note: To enable this feature in your environment, contact your Success Manager. Alternatively, you can submit a request at tickets@sprinklr.com.

Example

Search Input: Model ABC

Results Returned:

  • Model ABC

  • Model ABC1

  • Model ABCD

  • Model ABC123

Why: All values start with the full search string, ignoring case.

Substring Example

Search Input: del

Results Returned:

  • Model

  • Model ABC

  • Odel Airlines

  • Model 2000

Why: Values are returned when the search term appears anywhere in the label.