Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Work Tasks

Add a New List Item with Grid Items

  • Last UpdatedJun 25, 2024
  • 4 minute read

AVEVA Work Tasks allows you to add list items with grid items to any list using the XML variable. Update Variable activity can be used to perform this task. An XML Iterator type XML variable should be created to add the grid items (child items) and the XML Navigator activity can be used to point to the grid.

This can be explained through the scenario mentioned below.

A list Purchase Orders has been created with the following fields.

  • Reference Number

  • Purchase Order Date

  • Raised By User

  • Deliver To User

  • Status

  • Purchase Order Details

    • Item Name

    • Quantity

    • Unit Price

    • Item Total

  • Total Purchase amount

From the workflow, you have to add an item along with the child item to the Purchase Orders list.

To add a new list item with grid items

  1. Logon to the Enterprise Console and launch Workflow Designer page.

  2. You need to create an XML List type XML variable for the Purchase Orders list. If the variable is not created, follow the procedure mentioned below to create the variable.

  3. Click the More button in the XMLVariables property from the Start Activity Properties.

  4. Click New Variable to add a new variable.

  5. Type the variable name as 'purchaseorders'.

  6. Select type as XML List from the Type drop-down list.

  7. Type the List name in the Select List field or click Select List button to select the list. In this case select Purchase Orders list.

  8. Select New as scope from the Choose the ListItem to work on options to point to the new item in the list.

  9. Now you can see the XML nodes in a tree menu that are mapped to the controls while creating the list. You can also notice that the parent XML nodes and child XML nodes (PurchaseOrderDetails grid) are also displayed.

  10. Click Save Variable. A message is displayed saying ‘Variable Updated’. Close the window.

  11. Drag and drop Update Variable activity to add an item in the list.

  12. Click the Set Variables button icon in the Set Variables property.

  13. Click the Select link and select the respective field of the XML List type XML Variable created for the list (in this case purchase orders). The fields displayed in the tree-view are representing the XML nodes of the controls in the list.

  14. Select a field for which you want to set the value from the tree- view. Then enter the value for the field in the right-hand side text box. If you want to set the value, select enter a value from the tree-view, and then type the value. Also you can select variables or contents or any XML variables nodes directly by selecting the respective node from the tree-view. If you want to combine multiple node values, you can build an expression by selecting Build Expression.

  15. After setting the value for all the fields in the parent item (controls in the main form) that you want to add, click OK. This will add a list item to the list, while executing the workflow, with the fields in the main form.

  16. If you want to add an item to the grid (in this case, if you want to add a Purchase Order Details grid item), use Xml Navigator activity. Xml Navigator can be used to point to an item in the grid (Purchase Order Details in this case). For this purpose you need to create an Xml Iterator type Xml Variable. This can be created from the Start activity XML variable property. In the XML Variable screen, click New Variable.

  17. Type the variable name as purchaseorderdetails.

  18. Select Xml Iterator from the Type drop-down list.

  19. Select purchaseorders from the Xml Variable drop-down list.

  20. Select the repeating node (Qualification) from the Node Select drop-down list.

  21. Click Save Variable. A message is displayed saying ‘Variable Updated’. Close the window.

  22. Drag and drop Xml Navigator activity.

  23. Select purchaseorderdetails from Xml Iterator drop-down list and select Yes from Create New Node properties to create a new node.

  24. Select the appropriate Location. The available options are:

    First: Navigates to the first record in the collection.

    Last: Navigates to the last record in the collection.

    Next: Navigates to the next record based on the current location.

    Previous: Navigates to the previous record based on current location.

    Index: Navigates to the record identified in the Index field.

  25. Since we have to append the items in Purchase Order Details grid, select the option as Last.

  26. Click Save.

  27. Drag and drop the Update Variable activity to enter the grid field values.

  28. Click the Set Variables button in the Set Variables property.

  29. Click the Select link and select the respective field of the XML Iterator type XML Variable created for the list (in this case purchaseorderdetails), i.e. grid items. The fields displayed in the tree-view are representing the XML nodes of the controls in the Purchase Order Details grid.

  30. Select a field for which you want to set the value from the tree- view and type the value for the field in the right-hand side text box.

  31. After setting the value for all the fields in the child item, click OK. A new item with grid will be added to the list while executing the workflow.

    Note: If you want to add multiple items, use XML Navigator and Update Variable activities for Iterator within the For-Next Loop activities

TitleResults for “How to create a CRG?”Also Available in