Generic Adaptor (1.0) Missing Dataset Product Field Data Report
The routine generates a spreadsheet CSV report file that outlines the products within the a Connector's Data Set that are missing data. The report can make it easier for data maintainers to determine what product data they need to add to products, making it quicker and easily to add the missing product data to allow the products to be sold in associated Ecommerce platforms.
Optionally the routine can send out an email containing the report's spreadsheet file, as well as the summary of the product data field counts that contain missing data.
Topics |
Prerequisites
Please make sure you understand what the Connector's Data feature is, what CSV spreadsheet files are, and have read the following linked documents before proceeding on.
How It Works
The Missing Data Set Product Field Data Report routine will query a specified Connector Data Set SQLite database file and generate a CSV spreadsheet file that contains a list of products that are missing data for at least one of the included fields. It will save the report's generated report spreadsheet file to a specified location on the file system, allowing it to be access by Windows users to view and modify using any spreadsheet application (such as Microsoft Excel, or Libre Office Calc). Optionally the routine can email out the report to a nominated list of email addresses, with the email containing a summary of product field counts that are missing data. In the email it will also attach the report's spreadsheet file. This allows data maintainers to receive the report, either on a scheduled or once off basis when the routine is run.
For this routine to be effective it requires product data to be be set up or imported into a Data Set via an adaptor's Products data export. The product fields that the routine looks can be managed through the use of the routine's Data Fields. The routine also allows for highly customised conditions to be set within the routine's Data Fields, allowing highly customised checks to be made with each product, such as checking that a product is a assigned to a category, image, or attachment, among many other examples. This is done by adding routine data fields for product field that needs to be checked. Either the product's existing fields can be selected, or customised SQL queries can be written, such to check if a product has any images or categories assigned to it, among many other examples.
A number of settings can be configured for the routine. This includes settings that control how the CSV spreadsheet file's data is formatted, as well as settings to control if the routine should only look at active and/or updated products. It also includes settings that control if the routine should email out the report, and details of the email.
When the routine is run, if the DEBUG logging is set to show within the Connector's message logs, then it will show a summary of counts of each field that contains missing data, as too will the email notification if it is set to be sent out.
Routine steps:
- Get the list of the routine's active data fields that contain a value source field.
- Build the SQL database query that will check for the different product data that is missing.
- Check that the Data Set's SQLite database file exists.
- Connect to the Data Set's SQLite database file and execute the SQL query to generate the report data
- Build the spreadsheet CSV file data with the report's generated data.
- Save the report's CSV spreadsheet file to the filesystem at the specified location and file name.
- Output the summary of missing product field data into the Connector's message log.
- If the routine is set to send out an email notification then generate the contents of the email message, and attach the spreadsheet CSV file to the email message.
- Send out the email report to the recipient email address, using the SMTP settings of the adaptor that is running the routine.
- Log the outcome of sending the email notification within the Connector's message logs.
Routine Setup: Creating a new Missing Dataset Product Field Data routine
- Open up the Connector application.
- In the Adaptors and Messages tab, Under the Adaptors section, click on the Settings button against a listed Generic adaptor.
- Click on the Data Routines tab.
- In the Routine Type drop down, select the Missing Dataset Product Field Data option, then click the Create Routine button.
- In the Routine Code text box enter a name for the routine, then press the Save Routine button.
A new routine will be created for the adaptor and appear in the Routines drop down.
Routine Setup: Configure Settings
- Click on the Settings tab of the routines.
- For each row in the settings table, click on the Setting Value field.
- Enter a setting value, then click to the next row. The setting will automatically save once the cursor exits the field.
- Click on the Data Fields tab.
- Click on the Add Field button to add a data field to the routine for each product field that needs to be checked for missing data.
- Within Source Field column set the value of the argument. If the value contain spaces then wrap the value with double quote characters.
Notes:
- In the Routine Settings section below describes what each of the settings does. Use this to configure the routine or read the settings documentation below.
- If a red icon appears in the routine table's Setting Value cell, then the cell does not accept the given input. You will need to change the value in the cell to be valid.
Routine Settings
Below are the settings that can be configured for the routine.
Setting label | Allowed Values | Description |
---|---|---|
Send Report Notification Email | true,false |
If set to true then the missing data report will be sent out via email, containing both a summary and attached CSV spreadsheet file. |
Report Notification Email Subject | Any Characters | Set the subject set in the report notification email. |
Report Notification From Email Address | Allowed Email Characters | Set the email address that will be set in the From email address if the Report Email Notification is sent out. |
Report Notification To Email Addresses | Allowed Email Characters and Commas | Set a comma delimited list of addresses that the report notification email will be sent to. |
Report CSV File Save Path | Allowed Filename Characters | Full file path and file name to save the report's spreadsheet CSV file to. Note that the path should not use a mapped network drive unless the Connector's Host Windows Service is configured to run as a Windows user that the mapped network drive is available to. Otherwise use a full UNC path to reference a network drive and ensure the Windows "System" user has access to the drive. |
Report CSV Data Row Delimiter | Any Characters | Controls how each row of data is delimited in the report's CSV spreadsheet file. |
Report CSV Data Field Delimiter | Any Characters | Controls how each cell of data is delimited in the report's CSV spreadsheet file. |
Report CSV Data Field Enclosing Character | Any Characters | Controls how each cell of data is enclosed in the report's CSV spreadsheet file. |
Report CSV Data Field Escaping Character | Any Characters | Controls how characters in each cell value of data are escaped in the report's CSV spreadsheet file. |
Filter Active Records | true,false | If set to true then include in the report product records that are active. |
Filter Inactive Records | true,false | If set to true then include in the report product records that are inactive. |
Filter Updated Records | true,false | If set to true then include in the report product records that are updated. |
Filter Not Updated Records | true,false | If set to true then include in the report product records that are not updated. |
Data Set File Path | Allowed Filename Characters | Full file path and file name where the Data Set SQLite file is located. Note that the path should not use a mapped network drive unless the Connector's Host Windows Service is configured to run as a Windows user that the mapped network drive is available to. Otherwise use a full UNC path to reference a network drive and ensure the Windows "System" user has access to the drive. |
Routine Message Meanings
Listed below are a majority of the messages that are generated by the routine, either through the connector logs, or in the sent email notification.
Type |
Message | Meaning |
---|---|---|
Error | The Missing Data Report failed to be generated. Error: errorMessage |
This error occurs when the routine fails to run the database query on the Data Set SQLite database file to generate the missing product data report. This could happen for a number of reasons, including:
|
Error | The Missing Data Report failed to save to the file system. Error: errorMessage |
This error occurs when the routine tries to save the generated spreadsheet CSV file to the file system. This could occur for a number of reasons, including:
See the error message displayed in the log to determine which one of these problems it may be related to. |
Error | An error occurred while trying to send out an email notification for the routineLabel routine. | This error occurs when the routine tries to send out an email notification of the report and fails. This could be because the adaptor's Email server setting have not been configured correctly, if if the From and To recipient email settings have been incorrectly configured. |
Info | For routine: routineLabel the Missing Data Set Product Data Report was succesfully saved | This message occurs when the routine was able to successfully generate the Missing Data Set Product Data Repot spreadsheet file and save it the location on the file system. |
Info | Missing Product Data Report Summary | This message occurs when the routine was able to successfully generate the Missing Data Set Product Data Repot spreadsheet file and outputs each of the product fields and the counts of products that were missing for each field. |
Info | An email notification has been sent out for the routineLabel routine. | This message occurs when the routine has successfully sent out an email notification containing details of the attempt the routine made to generate the report, and if successful the details of the report. |
Debug | Attempting to generate the report data | This message appears before the routine attempts to generate the report data when connecting to the Data Set file. |
Debug | Attempting to create and save the report's CSV spreadsheet file. | This message appears when the routine has successfully generated the report data, and before it tries to save the report data into spreadsheet CSV file. |
Debug | Attempting to send out an email notification for the routineLabel routine. | This message appears when the routine is about to send out the email notification containing the details of how the routine ran. |