Working with Data Structures {$.steps.myData}

At its core, Tray allows you to access individual data elements from application A, and insert them into application B using conditional logic.  To use these data elements, you first must understand how to accurately pinpoint and reference them in various data structures.

Tray has made this easy for you in most cases, with the introduction of Dynamic Output Schemas.  The nifty interface returns graphical representations of data that are when dragging a query line between an input and a connector.

Our Dynamic Output Schemas are great at selecting common pieces of information and structures you can loop through.  However, with programs such as Clearbit, where hundreds of different data points could be returned, you may need to write a bit of code (we promise it isn't as scary as it sounds).


The first step is to identify the name and location of the attribute you would like to access.  The best way to do this is to create a new workflow with a Manual trigger, and the connector you wish to retrieve information from.  Make sure to authenticate your connector, select your desired 'Operation' and enter in all required data necessary to run.  You'll know all required data is present with the red (!) disappears from the top-right corner of your connector.

Click 'Run Workflow' and go to the 'Debug' tab.  Click on the entry at the top of the list (this will be the one associated with your most recent workflow run).  Then, click on the entry that corresponds to the name of the connector you are testing.  Scroll through the Output and find the data attribute you are looking for.

Pinpoint with code

Here's the fun part.  Use the correct notation to drill down into a data structure.


These are denoted by square bracket notation [...]

"my_list": [
"item_A", (index 0) To access this item... my_list[0]
"item_B", (index 1) To access this item... my_list[1]
"item_C", (index 2)
"item_D"  (index 3) To access this item... my_list[3]


These are denoted by curly brace notation {...}

"my_object": {
"key_A": "value_A", To access this item... my_object.key_A
"key_B": "value_B", To access this item... my_object.key_B
"key_C": "value_C",
"key_D": "value_D"  To access this item... my_object.key_D

Objects Nested in Arrays

"my_list": [
"key_A": "value_A", To access this item... my_list[0].key_A
"key_B": "value_B"  To access this item... my_list[0].key_B
"key_A": "value_A", To access this item... my_list[1].key_A
"key_B": "value_B"  To access this item... my_list[1].key_B

Arrays Nested in Objects

"my_object": {
"my_list_A": [
  "item_A",     To access this item... my_object.my_list_A[0]
  "item_B"      To access this item... my_object.my_list_A[1]
"my_list_B": [
  "item_A",     To access this item... my_object.my_list_A[0]
  "item_B"      To access this item... my_object.my_list_A[0]
Last updated 9th April 2017