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: The Label is the user-friendly name for an object, field, or component that is displayed in the user interface (UI). It is designed to be easily understood by end-users and often includes spaces or capitalization for readability (e.g., "Customer Status").

  • Help Text is the text that will be displayed to the end user to understand the label's meaning. 

  • 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. 

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

  • Options Source: Sprinklr provides various sources to add to the picklist options. The options available are:

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.

  • Label: Label represents the column headers 

  • 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.

  • 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.

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. 

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

    Note: When a picklist is configured with data source as By Entity Type, the values of the picklist will be sorted and displayed in alphabetical order.

    Access to this feature is controlled by a dynamic property.

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

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

  • 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.

  • Filter Records: You can apply a filter based on the fields available in the entity.

    Support for displaying all the defined Picklist values

    When using the By Entity Type data source for a picklist, you can choose to display all defined values for the field even if some of those values are not currently used in any records.

    For example: Airline Type Picklist

    If you have a custom entity with a field called Airline Type, configured as a Single Select List with the following defined values:

    • Interstate

    • International

    • Intercity

    • Charter

    • Test Airline

    If only Interstate and International were used in existing records, the picklist shown to agents during workflow execution would display only those two options. This meant agents could not select other valid options like Intercity or Charter unless records already existed using those values.

    With the feature is enabled, the picklist will display all configured values of the Airline Type field, regardless of whether they are currently in use. This ensures that agents always have access to the full set of defined options.

    Note: This feature is controlled by a DP and is configurable on a per-environment basis. When the DP is disabled, the system continues to show only values present in existing records. When enabled, the picklist will reflect the complete set of configured options regardless of usage.

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. 

  • 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]