3.02 Bulk Update Action Configuration

What is a Bulk Update Action?

The  Bulk Update action updates records in bulk in a table, including saving new records. Only records which satisfy the specified filter criteria set on the node will be updated. 

Note: Bulk Update actions will only update records in tables with the Period of Transactional.


 How to check a table's period

The table periods are:

Transactional

This allows multiple users to run independent analysis tasks at the same time.

Daily

This is a non-transactional table type, and generates or collects data every day.

Monthly

This is a non-transactional table type, and generates or collects data every month.

Variable

This is a non-transactional table type, and generates or collects data since the more recent run of the table to the current date.

To check the period of a table:

  1. Find the table in the  Repository
  2. Right-click it, then choose  Edit
  3. On the table's  Properties tab, in the Analysis Options section, the Period drop down can be found

 Save vs  Bulk Update 

The key difference between  Bulk Update and  Save is that the Bulk Update action will not update the audit history of records where Audit Manual Changes has been enabled.

To update records and persist the audit history of the record, see 1.09 Save Action Configuration.  

Creating Bulk Update Actions

  1. Click the  Bulk Update icon in the toolbar to display any existing tables in the application
    1. Existing tables can be dragged from the Repository onto the canvas, then choose  Bulk Update to create a Bulk Update node
  2. Alternatively, drag the  Bulk Update icon from the toolbar onto the canvas
  3. In the Create Bulk Update Action window:
    1. Enter a Name
    2. Choose to Allow Audited Table to display tables with Audit Manual Changes enabled in the Table drop down
      1. By default, tables with Audit Manual Changes enabled are not shown in the Table drop down list
    3. Choose the Table from the drop down where the records will be updated
      1. Or click the table icon to display tables in the Repository
    4. Select Create Action

When creating update actions it can be useful to set up confirmation messages that allow users to confirm or cancel the update. See 1.13 Confirmation Message Configuration.

Setting Update Action Filter Criteria

A filter must be set for the Bulk Update action to run. Set this in the Data Retrieval Options section of the   Properties.

  1. Choose a Data Range from:
    1. Latest: selects data from the latest recordsets
    2. All: selects data from all recordsets (default)
  2. Set the Filter Criteria to specify which records will be updated. See Filter → Filter Details
    1. Incoming attributes mapped to the Bulk Update node can be referenced in the Data Retrieval Options using the syntax, ConnectorName.AttributeName, e.g. in.MyAttribute


Worked Example

Here's a worked example using the Company Data (available from the Learning Centre).

In this example, we are using:  

  • Company Management screen containing a grid of the Companies data and a card container of their associated Employees - this screen was created using the Multi-Tile template
  • Company Merger Pop up screen containing:
    • two manual drop down fields of the company name's of the companies to be merged
    • two string fields showing the company ID's of the companies to be merged
    • a button to initiate the Actionflow - this screen was created using the Tile no Buttons template
  • Company Orders screen containing two grids of the Orders and OrderLines data - this screen was created using the Multi-Tile template

If you are completing this chapter as part of the Actionflow course and using a training instance, the data and screens have already been pre-loaded into the Actionflow Advanced Application. For this example, we'll be working on the Company Management screen.

Bulk Update Employees and Orders for Company Acquisition

In this example, a company is being merged into another company and we need to update the employees and orders to reflect the change.

Actionflow Setup

  1. Open the Company Management screen
  2. Click the Merge button to open the Company Merger Pop up screen
  3. Create an Actionflow on the Run Acquisition button
    1. Name: RunCompanyAcquisition
  4. On the Actionflow canvas, toggle on  Close screen after action completes
    1. This ensure the pop up screen closes after the acquisition has been run
  5. Configure the input connection point to the Company Merger form
  6. Map in the two CompanyID fields from the screen, CompanyIDBeingAcquired and CompanyIDDoingAcquiring

Bulk Update Action Setup

A Bulk Update action is required to update the data in each table.

  1. Create two  Bulk Update actions: one to update the Employees data and one to update the Orders data
  2. Drag the  input onto each action

Update Employees  Bulk Update Setup

Map in the required data and set up the action to update the data with the replacement company details.

  1. Map the attribute, CompanyIDDoingAcquiring, onto the CompanyID attribute on the table
  2. Drag across the attribute, CompanyIDBeingAcquired, into the drag and drop space to create an additional mapping
  3. On the  Properties for the Employees Bulk Update action, set the Data Retrieval Options to:
    1. CompanyID
    2. equals
    3. in.CompanyIDBeingAcquired

Update Orders  Bulk Update Setup

Map in the required data and set up the action to update the data with the replacement company details.

  1. Map the attribute, CompanyIDDoingAcquiring, onto the Customer_ID attribute on the table
  2. Drag across the attribute, CompanyIDBeingAcquired, into the drag and drop space to create an additional mapping
  3. On the  Properties for the Orders Bulk Update action, set the Data Retrieval Options to:
    1. Customer_ID
    2. equals
    3. in.CompanyIDBeingAcquired

Why is a Bulk Update action not needed for Order Lines?

The OrderLines data has a direct relationship with the Orders data via the OrderID. The OrderLines data has an indirect relationship with the Companies data via the OrderID, therefore, updating the Orders data is sufficient.


 Checkpoint

Testing

  1. Close all screens and reopen the Company Management screen
  2. Decide which two companies you will merge
    1. Make a note of their employees on the Company Management screen so you can see if the merge is successful
    2. Open the Company Orders screen and make a note of any Orders and Order Lines for the two companies
  3. On the Company Management screen, click the Merge button to open the Company Merger Pop up screen
  4. Select the two companies using the drop down fields and click the Run Acquisition button
  5. Review the screens to check the merge was successful


 How to Reinstate Data

Reinstating Data

After testing, you may wish to remove the changes you've made and reinstate your data to use again. Ensure you have downloaded the data from the Learning Centre.

  1. Open the Advanced Actionflow Data Analysis Model
  2. Right-click on a  Table where the data has been changed and select Rollback
    1. Select to Rollback all data
    2. Toggle off Keep Old Recordsets
    3. Click Confirm
  3. To reupload the data in its original form, hover over the table's   File Collector and choose  Upload File
  4. Select the downloaded file on your PC
    1. Click Upload File
  5. Hover over the connected table and choose  Run Analysis
  6. Repeat these steps with all tables where the data has been changed and requires reinstating
  7. Once the data is restored for each table,  Save the Analysis Model