How to make and use sets of sets

Allie Cliffe
  • Updated

Learn two ways to make sets of entity_set tables in Terra. Entity_set tables can be used as inputs for workflows that expect an array as input. Sets of entity_sets are useful if you want to run multiple workflows on the same subset of sets.

Note that you cannot create an entity_set_set table TSV outside Terra to upload to a workspace. Saving a subset of an entity_set table as a set (in the data page) or running a workflow are currently the only ways to make sets of sets.  

Overview: When would you use sets of sets

If your workflow takes an array as input, you may use a set table as the root entity type. If you then wanted to run on a subset of these input sets, without having to manually select them every time, you would need a set_set table! See two examples below.

Example: sm-student-v3 table

Sets-of-sets-example_student-v3-table-Screenshot.png

The table student-v3 above (from the Data Tables Quickstart) includes separate rows for each student's grades in three subjects: language arts, math, and science.

Example: sm-student-v3_set table

Sets-of-sets-example_student-v3_set-table_Screenshot.png

Each member of the sm-student-v3_set table is one student - identified by their student ID. Each set contains the three rows in the sm-student-v3 table. 

Example 1: contents of BZ460 set

Sets-of-sets-example_student-v3_set-table-contents_Screenshot.png

If you then wanted to make a set of some of the students (a set of members of the sm-student-v3_set table), you would have a sm-student-v3_set_set table.

Example: sm-student-v3_set_set table

Sets-of-sets-example-student-v3_set_set-table_Screenshot.png

Option 1: Make a set_set table in the workspace data page 

You can choose specific rows in your entity_set table to make a set right in the data page of your workspace. 

1.1. Start in the root entity table (entity_set). Select the rows of sets to include in the set_setCreate-sets-of-sets-in-workspace_Select-sets_ScreenShot.png

1.2. Click on Edit (above the table) and select Save selection as set from the menu.
Create-sets-of-sets-in-workspace_Save-selection-as-set_Screenshot.png

1.3. In the Create set pane, give the set a name and click Save.
Create-sets-of-sets_Give-set-a-name_Screenshot.png

1.4. You will see a new entity_set_set table with the sets you chose as members.
Create-sets-of-sets_Example-student-v3_set_set-table_Screenshot.png

Video demonstration

Create-set-of-sets-in-data-page_ScreenCapture.gif

Option 2: Make a set table by running a workflow

If you run a workflow on two or more entities (rows) in an entity table, Terra will automatically generate a set of those rows. If you run a workflow on an entity_set table (root entity type entity_set), Terra will generate an entity_set_set table. 

2.1. Start in the workflow configuration pane. In Step 1, select the root entity, choose the entity_set from the dropdown.
Create-a-set-set-by-running-a-workflow_Workflow-configuration-card_Screenshot.png

2.2. In Step 2 Select Data, check the Choose specific entities to process radio button.
Create-sets-of-sets-by-running-a-workflow_Set-up-the-workflow.png

2.3. Select two or more rows of data from your entity_set table. 

2.4. In the field at the bottom of the form, give the set_set a custom name (or use the name assigned by Terra). 

2.5. Click the OK button at the bottom right of the form to save.

2.6. Configure the workflow by choosing this.entitys from the dropdown and adding `.` and the column name (that holds the data in the entity table). 

Correct attribute formatting for root entity type entity_set

this.entitys.columnName

Note that the "s" at the end of the entity table name is required and will appear in the dropdown

Configuring hint for nested setsNote that when you are running on entity_set tables (as the root entity), you will need to be careful about the formatting of your inputs. The format for the attribute in the workflows configuration card is this.enity-name+s.column-name

Note that if you have a blank configuration card and select an entity set (i.e. sm-student-v3_set) for the root entity type, this.entitys (i.e. this.sm-student-v3s)will appear in the dropdown. You will have to add the period and the column name that holds the input data (in the entity table)

2.7. Run the workflow. When the workflow is done, there will be a new entity_set_set table in the Data page with the subset of set data you processed. You can run another workflow on the same set of sets again and again. 

Video demonstration

Create-sets-of-sets-by-running-a-workflow_ScreenCapture.gif

Was this article helpful?

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.