Tasks
- 1 Overview
- 2 Erase Data
- 2.1 Configuration
- 3 Run Scripts
- 3.1 Configuration
- 3.1.1 Get Query Results
- 3.1.2 Details
- 3.1.3 Latest Execution
- 3.1.3.1 Logs
- 3.1.4 Executions
- 3.1.5 Creating a Favorite
- 3.1 Configuration
- 4 Saved Views
Overview
Tasks allow users to do additional steps to their data within the integration process. Tasks are available within the Tasks section and also easily accessible for use in the Workflow section and Workflow Wizards. The Tasks section features an Delay Type, Erase Data Type, or Script Type.
Erase Data
Erasing Data is available in Adaptive via DataBlend.
Please note that the Erase Data Task is permanent and that once data is erased it is unable to be retrieved.
Configuration
Setting | Required/ Optional | Description |
---|---|---|
Name | Required | Select free text. This will be the name of your new Task. |
Type | Required | Select Erase Data |
Credential | Required | Select Adaptive credential from the list. |
Plan or Actuals | Required | Select Plan or Actuals. |
Plan Version Name | Required | Include free text as a descriptor. Users can utilize this to easily identify different plan versions . |
Account Type | Required | Select GL, Custom, or Cube. |
Start | Required | Select Start Date from the drop-down menu. Please note that start date is able to be parameterized via the options tab next to start. |
End | Required | Select Start Date from the drop-down menu. Please note that end date is able to be parameterized via the options tab next to end. |
Include Cell Notes | Optional | Enable or disable the Include Cell Notes toggle. |
Filter Mode | Optional | Select None or Manual. |
Run Scripts
DataBlend supports users wishing to create custom scripts within the DataBlend Script Task. The DataBlend Script Task is a unique connector in that the connection is established within the DataBlend application and collects data from other DataBlend Collectors using arbitrary JavaScript with tie-ins to .NET with the help of jint. Any asynchronous methods should use .Result
to wait for the method to complete. Establishing the connection is simpler than other DataBlend connections as this Task does not require a Credential to be created first. To learn more about the DataBlend script feature please visit https://datablend.atlassian.net/wiki/spaces/DS1/pages/2901377025 or https://datablend.atlassian.net/wiki/spaces/DS1/pages/2905112582.
Configuration
Setting | Required/ Optional | Description |
---|---|---|
Name | Required | Select free text. This will be the name of your new Task. |
Type | Required | Select Run Script |
Script | Required | DataBlend supports a variety of scripts tasks within the DataBlend platform. |
Get Query Results
const getMostRecentQueryExecutionByQueryId = (id) => {
const search = importNamespace('Datablend.Search');
const models = importNamespace('Datablend.Api.Models');
const QueryExecutionSearch = search.Search(models.QueryExecution);
const OrderList = System.Collections.Generic.List(search.Order);
let executionSearch = new QueryExecutionSearch();
executionSearch.Limit = 1;
executionSearch.Orders = new OrderList();
executionSearch.Orders.Add(search.Order.Descending('created'));
executionSearch.Predicate = search.Predicates.Junction.And(search.Predicates.Property.EqualTo('parent.id', id), search.Predicates.Property.EqualTo('state', 'Complete'));
executionSearch = QueryExecutions.Search(executionSearch).Result;
return executionSearch.Results[0];
};
const getRecordsFromQueryExecution = (id) => {
const sys = importNamespace('System');
const global = importNamespace('System.Globalization');
const io = importNamespace('System.IO');
const csv = importNamespace('CsvHelper');
const stream = QueryExecutions.Results(new sys.Guid(id)).Result;
const streamReader = new io.StreamReader(stream);
const csvReader = new csv.CsvReader(streamReader, global.CultureInfo.InvariantCulture, false);
return csvReader.GetRecords(new sys.Object().GetType()).ToList();
}
const queryId = '21234546-c122-4a16-99fe-41234567892272';
const queryExecution = getMostRecentQueryExecutionByQueryId(queryId);
const records = getRecordsFromQueryExecution(queryExecution.id);
log(records[0].first_name);
Details
The details section documents who the Task was created and updated by and the corresponding times. This allows for easy tracking of multiple Tasks.
Latest Execution
The latest execution section documents the state of the Task, created time, and status of the Task. States include complete, cancelled, and error.
Logs
Job logs are easily accessible via the state link in the Latest Execution section. Click the linked state and the user is taken to the Executions section. Here users view items, details and logs related to the ran job. Logs are downloadable via the download log button indicated at the top right of the log section. Logs are useful to see how much data was collected, the steps taken, and the time in which it occurred.
Executions
The executions section documents when the Task was created, started, completed and the total amount of data scanned. The status includes information regarding the state of the Task. This allows for easy tracking of multiple Tasks.
Creating a Favorite
Creating a favorite is simple. Users may favorite a Credential, Collector, Data Target, Query, Data Source, or Workflow. To create a favorite, users navigate to the star icon on the upper left next to Edit.
Saved Views
Saved views are a unique feature offered by DataBlend that allow users to quickly view filtered searches. Setting a saved view is simple. Click the gear icon in the upper right corner. A drop-down will appear with option to save the current view, restore the default view, or copy share URL. Copying a Share URL will allow other users with the URL to view the same saved view.