Sometimes when applications are changed some business data used by the application may need to be updated. Changes to an application can include adding or removing fields in a table or changing how a logic block calculates a value in a table. Data transform logic blocks are used to update the business data.
For example, if several empty fields in a SalesOrderDetail table need to be populated for the next release to accommodate changes made to the Sales Orders application, a data transform logic block could do the following actions for the table:
- For all SalesOrderDetail records with an empty Scheduled Pick Date field, populate the field with the ShipRequestDate value.
- For all SalesOrderDetail records with an empty Price Effective Date Time field, populate the empty field with the field specified in the Sales Pricing Date list lookup in Sales Settings application. If this list lookup is empty, it populates the Price Effective Date Time field with the current date.
- For all SalesOrderDetail records with an empty Gross Extended Price field, calculate the GrossExtendedPrice as Price × Requested Quantity and populate that field with the resulting value.
Use the Logic Builder in the Logic Block application to configure a data transform logic block that uses either an Update Record or a Bulk Update action to transform the data.
- Use the Bulk Update action for records to be uniformly altered. It is the most efficient way to alter a collection of records where all the records need to be updated to the same set of values. Learn more in the Bulk Update action topic.
- When records need to be individually queried and altered, the records need to be fetched with an applicable fetch logic block action and then updated with an Update Record action.
A data transform logic block can only be run when connected to a record in the Data Transform Definitions application. You cannot run a data transform logic block using any other method. It can't be called from another logic block, an application, a workflow transition, or other actions.
If a data transform logic block already exists for the table to be transformed, modify the existing logic block as needed to include any additional actions you want to include for the data transform.
Messaging
There are three main message types when processing a data transform logic block:
- Background Task Progress—Used to inform on the progress of a data transform that is being executed.
- The number of processed records should be displayed as an input.
- The message should be in the format of "TableName data transform is in progress."
- Background Task Summary—Used to inform ops of transform completion when viewing the execution record.
- The number of processed records should be displayed as an input to this message.
- The message should be in the format of "TableName data transform is complete."
- Data Transform Message—Used to log messages throughout the transform logic block and to record critical information that Operations needs to know about.
- This message type is inserted into the Messages subtable of the data transform execution. These messages also are within the job ID attached to the Transform for each tenant run.
- Errors don't cause Transform to halt, but they do fail and need to be resolved.
For more information about data transforms see Data transforms.