With this chain, you can automatically create a table based on data in a comma-separated values (CSV) file. You can extract the CSV directly from your system of record through its own connector or retrieve it from an online directory. For example, this recipe uses the HTTP Request connector to retrieve the file from a directory.
Ingredients
To create this chain, you'll need:
- A Workiva connector
- A connector to retrieve the data directly from the source or an online directory; for example, this recipe uses an HTTP Request connector
- A File Utilities connector
Step 1. Create the chain
- In Chain Builder, from the Chains tab, click Create Chain.
- Under Setup, enter a unique name and description to help identify the chain and its intent.
- To enable the chain to retrieve files from various sources, under Variable, click Add, and create a variable for the base URL for the CSV:
- In Name, enter base-url.
- In Value, enter the path to the file's directory.
Step 2. Set up a notification
To notify other workspace owners when the chain creates a table:
- On the Notifications
- Under Condition, select Success.
- For Recipients, select the email addresses of the collaborators to notify.
- Update the subject line for the email as necessary, and click Save.
Step 3. Add a command group to get and list file content
To retrieve data from the online directory, start the chain with a command group to GET the file and list its content.
Note: To better meet your needs, you may instead start with a command that connects directly with your data source or an export file location.
- Click Command Group , and move Command Group to Start.
- Under Available BizApps, click HTTP, and move GET to the canvas.
- Drag a link from Group Start to GET, and click Edit
- Under Basic Info, enter a unique name and description to help identify the command.
- If the HTTP directory requires basic authentication or a certificate for its requests, enter the credentials under Command Properties.
- For URL, select the Base-Url variable under Chains, and append the remainder of the path to the file to retrieve, such as
/file-name.csv
. - Click Save.
- Under Available BizApps, click File Utilities, and move List File Content to the canvas.
- Drag a link from GET to List File Content, and click Edit
- Under Basic Info, enter a unique name and description to help identify the command.
- For File name, select the Response output under GET.
- To view only the first few rows of the file, under Preview lines, enter the number of lines to return.
- Click Save.
Step 4. Add a command group to create a table based on the file
- Click Command Group , and move Command Group to the canvas.
- Drag a link from the previous group's Out to this group's In.
- Under Available BizApps, click Workiva, and move Create Table to the canvas.
- Drag a link from Group Start to Create Table, and click Edit
- Under Basic Info, enter a unique name and description to help identify the command.
- For Name, enter a name of the table to create, and then, to ensure a unique name, append the Chain.ExecutorID variable under Runtime.
- Under Columns, add the columns included in the file.
- Click Save.
- Under Available BizApps, click Workiva, and move Create File to the canvas.
- Drag a link from Create Table to Create File, and click Edit for Create File.
- Under Basic Info, enter a unique name and description to help identify the command.
- For Table ID, select Id from the Table output under Create Table.
- For File, select the Response output under GET.
- In Name, enter a name to help identify the file to create. To ensure a unique filename, append the Chain.ExecutorID variable under Runtime.
- Click Save.
- Under Available BizApps, click Workiva, and move Import File into Table to the canvas.
- Drag a link from Create File to Import File into Table, and click Edit for Import File into Table.
- Under Basic Info, enter a unique name and description to help identify the command.
- For Table ID, select Id from the Table output under Create Table.
- For File ID, select Id from the Result output under Create File.
- Under Column Mappings, map the table's columns to the file's.
- Click Save.
Step 5. Publish and execute the chain
To complete and test the chain:
- Click Publish and Execute.
- Click Run Chain.
- To verify the chain works correctly, view the outputs of the chain's commands.