What is a Bulk Delete Action?
The
Insert excerpt |
---|
| _action_bulkdelete |
---|
| _action_bulkdelete |
---|
nopanel | true |
---|
|
action deletes records in bulk from a table, such as deleting all records, or those records which satisfy the specified filter criteria set on the node.
Note: Bulk Delete actions will only delete records in tables with the Period of Transactional.
Insert excerpt |
---|
| 1.09 Save Action Configuration |
---|
| 1.09 Save Action Configuration |
---|
name | TablePeriod |
---|
nopanel | true |
---|
|
Insert excerpt |
---|
| _action_delete |
---|
| _action_delete |
---|
nopanel | true |
---|
|
vs Insert excerpt |
---|
| _action_bulk_delete |
---|
| _action_bulk_delete |
---|
nopanel | true |
---|
|
The key difference between Insert excerpt |
---|
| _action_delete |
---|
| _action_delete |
---|
nopanel | true |
---|
|
and Insert excerpt |
---|
| _action_bulk_delete |
---|
| _action_bulk_delete |
---|
nopanel | true |
---|
|
is that the Bulk Delete action purges records from PhixFlow, including the audit history of records where Audit Manual Changes has been enabled.
To delete records and persist the audit history of the record, see Delete Node.
Creating Bulk Delete Actions
- Click the
Insert excerpt |
---|
| _action_bulkdelete |
---|
| _action_bulkdelete |
---|
nopanel | true |
---|
|
icon in the Actionflow toolbar to display any existing tables in the application - Existing tables can be dragged from the Repository onto the canvas, then choose
Insert excerpt |
---|
| _action_bulkdelete |
---|
| _action_bulkdelete |
---|
nopanel | true |
---|
|
to create a Bulk Delete node
- Alternatively, drag the
Insert excerpt |
---|
| _action_bulkdelete |
---|
| _action_bulkdelete |
---|
nopanel | true |
---|
|
icon from the toolbar onto the canvas - In the Create Bulk Delete Action window:
- Enter a Name
- Choose a Type from:
- Delete: allows only records satisfying the specified filter criteria to be deleted
- Set the filter criteria in the Bulk Delete Action
Insert excerpt |
---|
| _property_settings |
---|
| _property_settings |
---|
nopanel | true |
---|
|
under Data Retrieval Options - see section below
- Delete All: deletes all data from the selected table
- Choose to Allow Audited Table to display tables with Audit Manual Changes enabled in the Table drop down
- By default, tables with Audit Manual Changes enabled are not shown in the Table drop down list
- Choose the Table from the drop down where the records will be deleted
- Or click the table icon to display tables in the Repository
- Select Create Action
When creating delete actions it can be useful to set up confirmation messages that allow users to confirm or cancel the deletion. See 1.13 Confirmation Message Configuration.
Setting Delete Action Filter Criteria
Where the Type is set to Delete on the
Insert excerpt |
---|
| _action_bulkdelete |
---|
| _action_bulkdelete |
---|
nopanel | true |
---|
|
action, the
Data Retrieval Options section shows in the
Insert excerpt |
---|
| _property_settings |
---|
| _property_settings |
---|
nopanel | true |
---|
|
. This filter must be set for the Bulk Delete action to run.
- Choose a Data Range from:
- Latest: selects data from the latest recordsets
- All: selects data from all recordsets (default)
- Set the Filter Criteria to specify which records will be selected for deletion. See Filter → Filter Details
- Incoming attributes mapped to the Bulk Delete node can be referenced in the Data Retrieval Options using the syntax, ConnectorName.AttributeName, e.g. in.MyAttribute
Excerpt |
---|
|
Specify Delete Batch SizeWhere the Type is set to Delete on the Insert excerpt |
---|
| _action_bulkdelete |
---|
| _action_bulkdelete |
---|
nopanel | true |
---|
| action, in the Advanced section, an optional Delete Batch Size can be set to determine the size of the batches. If left blank the batch size set in System Configuration → System Tuning → Delete Batch Size, is used as the default. The System Configuration value can be overridden with this batch size. |
HTML Comment |
---|
|
Insert excerpt |
---|
| Bulk Delete Node |
---|
| Bulk Delete Node |
---|
nopanel | true |
---|
|
|
Worked Example
Here's a worked example using the Company Data (available from the Learning Centre).
In this example, we are using:
- A Company Rejected Companies screen containing three grids of the Companies, Orders and OrderLines data - this screen was created using the Multi-Tile template
Tip |
---|
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 Rejected Companies screen. |
Bulk Delete Rejected Companies
In this example, we'll set up an Actionflow to delete all companies with a Status of Rejected, along with any associated Orders and Order Lines.
View Setup
- Open the Company Rejected Companies screen
- Create an Actionflow on the Delete All button
- Name:
BulkDeleteRejectedCompanies
- Configure the input connection point to
Insert excerpt |
---|
| _actionflow_on_click |
---|
| _actionflow_on_click |
---|
nopanel | true |
---|
|
- Create a
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
to the Companies data to output the CompanyID of rejected companies only - Connect the input to the View
Expand |
---|
|
|
Lookup Setup
Create a lookup to the Orders data to retrieve the orderIDs as an array. The orderID can then be used to bulk delete the orders and orderLines. A lookup is used to pass a large block of data (an array) rather than one record at a time.
Expand |
---|
|
- Create a
Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
| to process the lookup Orders data - From the Calculate action, create a lookup the Orders data
- Incoming Mappings:
CompanyID - Outgoing Mappings:
Order_ID
- Create a filter on the Orders
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
| to only retrieve orders that match the incoming CompanyID - On the Calculate action, create an Output Attribute to process the Order IDs coming from the lookup as structured data
|
Expand |
---|
|
|
Bulk Delete Action Setup
- Create three
Insert excerpt |
---|
| _action_bulk_delete |
---|
| _action_bulk_delete |
---|
nopanel | true |
---|
|
actions for deleting from the three tables: Companies, Orders and OrderLines - Map the associated ID attribute into the relevant Bulk Delete node
Expand |
---|
|
- Map the following attributes from the Calculate action to the Bulk Delete action specified below:
- Delete Companies:
CompanyID (from the View) - Delete Orders:
OrderID (from the Calculate) - Delete Order Lines:
OrderID (from the Calculate)
|
- Set up filters on each node in the Data Retrieval Options section to ensure only records associated with a rejected company are deleted
Testing
- Return to the Company Rejected Companies screen and lock the screen
- Press the Bulk Delete button
- Refresh the data in each grid to see the results
- Review the Orders and Order Lines data to check there are no orders or order lines with a blank company
Excerpt |
---|
|
Expand |
---|
title | How to Reinstate Data |
---|
| Reinstating DataAfter 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. - Open the Advanced Actionflow Data Analysis Model
- Right-click on a
Insert excerpt |
---|
| _tables |
---|
| _tables |
---|
nopanel | true |
---|
| where the data has been changed and select Insert excerpt |
---|
| _rollback |
---|
| _rollback |
---|
nopanel | true |
---|
|
- Select to Rollback all data
- Toggle off Keep Old Recordsets
- Click Confirm
- To reupload the data in its original form, hover over the table's
Insert excerpt |
---|
| _file_collector |
---|
| _file_collector |
---|
nopanel | true |
---|
| and choose Insert excerpt |
---|
| _upload_file |
---|
| _upload_file |
---|
nopanel | true |
---|
|
- Select the downloaded file on your PC
- Click Upload File
- Hover over the connected table and choose
Insert excerpt |
---|
| _run_analysis |
---|
| _run_analysis |
---|
nopanel | true |
---|
|
- Repeat these steps with all tables where the data has been changed and requires reinstating
- Once the data is restored for each table,
Insert excerpt |
---|
| _save_saveModel |
---|
| _save_saveModel |
---|
nopanel | true |
---|
| the Analysis Model
|
|
3.04 Bulk Update Action ConfigurationImage Added