Bridge - Copy all attachment names to another sheet & get data from an array with a Child Workflow

Neil Egsgard
Neil Egsgard ✭✭✭✭✭✭
edited 04/10/24 in Best Practice

This solution copies all attachment names from a source row and adds one row for each attachment name onto a target sheet. Each target row contains one attachment name and the source row primary key. The solution uses a Child Workflow to get individual data values from an array in the Parent Workflow. The solution is very detailed and should be relatively easy to replicate and modify.

Workflow summary

Provides a summary of the workflow input and output.

  • Source data on source sheet
image.png
  • Source data on target sheet
image.png
  • Trigger is a user changes a source sheet “Status - Source” column cell to “Complete” and saves.
  • Source data transfers to target data as per below. 
    • Multiple attachments on a source row become multiple target rows.
image.png

Smartsheet items

These are Smartsheet items for this solution.

  • Bridge
    • Workspace: Basic Workflows
    • Parent Workflow: Copy all attachment names to another sheet
      • Gets row data and determines if row data should be added to target sheet
      • Triggers Child Workflow
    • Child Workflow: Retrieve data from array
      • Isolates attachment array data for each item and adds to target sheet
  • Smartsheet
    • Workspace > folder: Bridge > Basic workflow sheets
    • Source sheet: Copy all attachment names to a sheet - Source
    • Target sheet: Copy all attachment names to a sheet - Target

Workflow details

The details of each element in the Workflow, the element configurable values, and the value sources.

Parent workflow overview

Gets row data. If multiple attachments are present, the attachments details are stored in an array.

image.png


Child workflow overview

Repeats once for each attachment. Isolates array data and puts in on a new row on the target sheet.

image.png

Trigger element

image.png

Clicking the gear icon beside Smartsheet on the Trigger pane on the right allows adjustment of the trigger.

image.png

Get Row element

image.png

Fields, values, and sources

image.png

Value source for Get Rows “Sheet ID” and “Row ID”

Clicking “Copy Data Reference” for these items provides {{runtime.event.sheetId}} and {{runtime.event.rowId}}. Data Reference must be copied for each item.

image.png


Junction: Status – Source is Complete element

This is a Condition Junctions > Match element. It checks if the first value matches the second value.

image.png

Fields, values, and sources

image.png

Value source for Junction “First Value”

Clicking “Copy Data Reference” provides

{{states.startstate.smartsheet.get_row.row.cells.Status - Source.value}}

image.png


Child Workflow: Retrieve data from array element

Triggers Child Workflow using the Get Row – Attachment array. The Child Workflow will run one time for each data set in the Get Row – Attachment array. Each time the Child Workflow runs, it starts with the data from the array data set.

image.png

Fields, value, and sources

image.png

Value source for “Number of Runs”

Clicking “Copy Data Reference” provides

{{states.startstate.smartsheet.get_row.row.attachments}}

image.png

Value source for “Value #1”

Clicking “Copy Data Reference” provides

{{states.startstate.smartsheet.get_row.row.cells.ID - Source.value}}

image.png


Child Workflow Trigger element

image.png

Fields, values, and sources

image.png


Child Workflow Add Row element

image.png

Fields, values, and sources

image.png

Value source for “Value #1”

Clicking “Copy Data Reference” provides {{runtime.entities.ID - Source value}}

image.png

Value source for “Value #2”

Clicking “Copy Data Reference” provides {{runtime.data.name}}

image.png


Regards,

Neil Egsgard

Business Systems Architect

Southern Alberta Institute of Technology

Comments