Referencing data of dictionaries (dicts), lists, arrays - how to pass data dynamically


Referencing data such as dictionaries (dicts), lists, arrays, or CSV column style data is one of the more tricky tasks for business users who are not familiar with data objects in programming, but necessary to automate more complex flows and logic. It is pretty similar to complex spreadsheet functions. We try our best to make it as easy and intuitive as possible by providing you a wealth of documentation as well as examples in the Flow Automation Marketplace.


We rely on one of the industry-standards, JSON-Path, for all our referencing, as it is fairly intuitive and well documented.


Below you can find a variety of referencing examples to get you started. For any questions, please reach out to support.


Accessing list data in a nested dictionary

How to access data - the below is the result of the connector with the ref hubs1:

{
  "deals": [
    {
      "portalId": 123213213,
      "dealId": 345345345,
      "isDeleted": false,
      "associations": null,
      "properties": ...


To access the dealId in the next step, you need to write the following in the respective field where you want the data to be:  {{ hubs1.deals.0.dealId }}


Explanation:

  • All data referencing is based on Jinja2, the Python templating language. It is similar to Liquid or other templating languages, with some nouances.
  • The {{   }} is always used when data is referenced to from a previous step.
  • The hubs1 references the previous flow run step itself by its RefID
  • The deals references the object in the above JSON
  • Since within the "deals": [  a list is nested, indicated by the   [   order, we need to specify that we want to access the first object of the list, while the first one is in any programming related terms 0.
  • Lastly, we concatenate with periods a period he dealId. Note that the letter I in dealId is capitalized (Cammal case style) in this particular API from Hubspot. This is important, as APIs are case-sensitive.