閱讀及檢閱 Automation Anywhere 文件

Automation 360

關閉內容

內容

開啟內容

Example of using the Checkbox element dynamically

  • 已更新:2022/04/02
    • Automation 360 v.x
    • 組建
    • AARI

Example of using the Checkbox element dynamically

The Checkbox element in the AARI form enables you to select multiple options in a form during bot runtime. In this example, use the Checkbox element to generate dynamic options.

先決條件

You must have a Bot Creator license and be assigned a custom role with create folder permission.

In this example, we will create a process to register new employee details in the company database. The initial form contains basic information such as Name, ID, Date of Birth, Gender, and Location. The initial form has only two options (San Jose and Tokyo) for the Location field. We will make this field dynamic where during requestion creation, a new location (India) is added for those employees whose ID is in the 100 to 200 range.

程序

  1. Log in to the Control Room as a Bot Creator user.
  2. Create the initial form.
    1. On the left plane, click Automation.
    2. Click Create new > Form.
    3. Enter the form name employee_register_initial_form.
    4. Enter the folder location Bots\Employee Registration.
      To change where your form is stored, click Choose and follow the prompts.
    5. Click Create & edit.
    6. Use the following Elements and Element label in the form.
      Elements Element label
      TextBox Full Name
      Number ID
      Date Date of Joining
      Dropdown Gender

      For the Dropdown element, enter Male, Female in the Enter list items separated by commas field.

    7. Click Save.
    8. Click Close.
  3. Create another form.
    1. In the same folder location, click Create new > Form.
    2. Enter the form name employee_location.
    3. Click Create & edit.
    4. Drag the Checkbox element into the form.
    5. Enter the name in the Element label field Employee location.
    6. Click the plus icon in the Checkbox content field and add the locations San Jose and Tokyo.
    7. Click Save.
    8. Click Close.
  4. Create a new bot.
    1. In the same folder location, click Create new > Bot.
    2. Enter the bot name dynamic_checkbox.
    3. Click Create & edit.
  5. Create the following variables:
    • emp_id: Number type; use as input
    • emp_location: List type, String subtype; use as output; click the plus and add two values San Jose and Tokyo
    • emp_dyn_location: String type, add the default value India

    The default values are San Jose and Tokyo but if the employee ID falls between 100 and 200, the location India is selected.

  6. Use the If action to configure the conditional statement.
    1. Double-click or drag the If action.
    2. Select Number from the Condition drop-down list.
    3. In the Source value field, insert the variable $emp_id$.
    4. Select Greater Than (>) as the Operator.
    5. Enter 100 in the Target value field.
    6. Click Add condition and select And.
    7. Select Number from the Condition drop-down list.
    8. In the Source value field, insert the variable $emp_id$.
    9. Select Less Than (<) as the Operator.
    10. Enter 200 in the Target value field.
    11. Click Save.
  7. Use the List package into the If container to insert the new location as per the defined condition.
    1. Drag the List > Add item action.
    2. In the List variable field, select the variable in which to add the list item emp_location.
    3. In the Item to be added field, select the variable that contains the value to add emp_dyn_location.
    4. Click Save.
    5. Click Close.
  8. Create a new process.
    1. In the same folder location, click Create new > Process.
    2. Enter the process name employee_register.
    3. Click Create & edit.
    4. Click Start to add an initial form to the process.
    5. In the Select initial data form field, browse and select the initial form, that is employee_register_initial_form.
    6. Provide Request title as Employee Registration.
    7. Drag the Bot Task into the process editor from the Task field.
    8. In the Bot Task panel, Element name field, enter a name Location.
    9. Enter the Task name Generate location.
    10. In the Select Task Bot field, browse and select the bot you created dynamic_checkbox.
    11. In the Input values field, select the input variable emp_id.
    12. Drag the Human Task into the process editor from the Task field.
    13. In the Human Task panel, Element name field, enter a name location_form.
    14. Enter the Task name Employee location form.
    15. In the Select form field, browse and select the form you created employee_location.
    16. Click Add button.
    17. Specify OK for Button label and Primary for Button style.
    18. In the Feed data into form field, select the output variable emp_location.
    19. Click Save.
    20. Click Close.
  9. Deploy the process.
    1. Click Run.
      A request is created for the process.
    2. Enter the values for the initial form.
    3. Click Submit.
    The process deploys and if the employee ID falls between the values 100 to 200, the Employee location field will have a new option of India making this option dynamic. If the employee ID is not between the values 100 to 200, the Employee location field will have only two options, San Jose and Tokyo.
傳送意見反饋