Advanced working with data
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 shown 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.
Here's the fun part. Use the correct notation to drill down into a data structure.
"my_list": ["item_A", (index 0) To access this item... my_list"item_B", (index 1) To access this item... my_list"item_C", (index 2)"item_D" (index 3) To access this item... my_list}