Guided Workflow Custom Components - Loop Form

Updated 

Overview

A loop form is a component that allows you to iterate over a set of fields dynamically, making it easier to manage processes involving multiple items. The loop form dynamically generates separate forms for each item in a process based on the number of items selected. This enables users to input specific details for each item independently, such as reasons for return, quantities, or any other necessary field.

Example of an Order Management Process

Suppose a customer places a single order containing multiple items, such as:

  • Honey

  • T-shirt

  • Headphones

Now, the customer wants to return some of the items, but each item might have a different reason for being returned:

  • For honey, the reason might be that the bottle is leaking or the product has expired.

  • For the t-shirt, the reason might be the wrong size or a defect in the fabric.

The loop form addresses this scenario by dynamically creating individual forms for each item in the order.

How will it work?

  1. The loop form checks the number of items in the order.

  2. It generates a separate form for each item.

    • For honey, a form is created to specify the reason (e.g., leaking or expired).

    • For t-shirt, another form is created to specify the reason (e.g., wrong size or damaged).

  3. This process ensures that each item has its own dedicated form, allowing for accurate and detailed inputs.

Various Fields in Loop Component

  • API Name: This is the unique identifier for this button. For this widget, you need to ensure that there are no hyphens and spaces in this API Name field input. Ensure that the name does not start with a number or underscore.

  • Loop Collection Variable: This variable should hold the list of items for which the set of child elements on this Loop Form will be repeated.

  • Current Loop Item Variable: You can use this variable as a placeholder for the current loop item when configuring a child element for your Loop Form.

  • Loop Index Variable: Loop index variable needs to be used wherever you want to access specific index element. You need to use it in loop form visibility conditions.

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