With this chain, you can update a table's query dataset to append its latest data. For example, use this chain to automatically:
- Run a query for the latest results
- Append the results to the table as a new dataset
Tip: To replace—rather than append—the dataset with the latest results, build a chain to update the table's datasets, or select Replace from the dataset's menu to manually update the query results.
Ingredients
To create this chain, you'll need:
- The Workiva core connector
- The ID of the table to update
- The ID of the query used as the table's dataset
Tip: You can find the ID of the table or query after /tables/
or /queries/
in its URL.
Step 1. Create the chain
- In Chain Builder, from the Chains
- Under Setup, enter a unique name and description to help identify the chain.
- Under Variables, add variables for the IDs of the table and query.
- Click Save.
Step 2. Start with a Run query command
To generate the latest query results each time the chain runs, start with a Run query command:
- Under Available BizApps, select Workiva, and move Run query to the canvas.
- Move Run query to Start, and click its Edit.
- Under Basic info, enter a name and description to help identify the command.
- Under Command properties, select the Workiva connector to perform the command.
- For Query ID, select the chain variable for the query ID.
- If the query has parameters, add their values under Parameters or Multi-select params.
- Click Save.
Step 3. Add a Download query result command
To retrieve the results as a comma-separated values (CSV) file to upload as a dataset, add a Download query result command:
- Under Available BizApps, select Workiva, and move Download query result to the canvas.
- Drag a link from Start to Download query result, and click the command's Edit.
- Under Basic info, enter a name and description to help identify the command.
- Under Command properties, select the same Workiva connector as Run query.
- For Query result ID, select ID from the Query result output of the Run query command.
- Click Save.
Step 4. Add a Create file command
To enable the table to upload the CSV file, add a Create file command:
- Under Available BizApps, select Workiva, and move Create file to the canvas.
- Drag a link from Download query result to Create file, and click the latter's Edit.
- Under Basic info, enter a name and description to help identify the command.
- Under Command properties, select the same Workiva connector as the earlier commands.
- For Table ID, select the chain variable for the table ID.
- For File, select the Query result output of the Download chain result command.
- Click Save.
Step 5. Add an Import file into table command
To upload the query results to the table, add an Import file into table command:
- Under Available BizApps, select Workiva, and move Import file into table to the canvas.
- Drag a link from Create file to Import file into table, and click the latter's Edit.
- Under Basic info, enter a name and description to help identify the command.
- Under Command properties, select the same Workiva connector as the earlier commands.
- For Table ID, select the chain variable for the table ID.
- For File ID, select ID from the Results output of the Create file command.
- Under Column mappings, add key/value pairs to map the query result's columns to the table's columns.
- To apply any metadata about the dataset, such as its source or version, add the applicable tags and values.
- Click Save and Publish.