DDL operations


info

Please also see our Building a UI form tutorial for guidance on rendering DDLs in your integration.

Certain Tray connector operations have to dynamically respond to other information that may be determined by an End User.

For example when using the Trello 'Create new Card' operation in the Tray builder, you must use drop-down lists to select both the Board and List that the new card will be created in:

trello-create-card-select-list-v2

From the input schema retrieved using the Get connector operations endpoint, we know that the list_id, board and position are all required inputs.

The Ops Explorer dev tool can get us a quick view on what these inputs are.

You can identify any dynamic operations by the presence of a lookup field.

In this case we can see that the lookup for the board property is get_boards_ddl

ddl-trello-create-card

To test this operation you can hardcode these id values, which will result in a successful call.

However the 'Create new card' operation must work in a dynamic fashion, in that an end user must be able to specify the board and list.

Testing DDLs

get_boards_ddl is a standalone operation that you can use to list the available boards and allow your end users to select from.

A successful run of the operation will list the available boards:

queryresponse
Copy
Copied
{
  "operation": "get_boards_ddl",
  "authId": "2c21aae5-xxx-xxx-xxx-xxx3e478f1dcf",
  "input": {}
}
Copy
Copied
{
  "outcome": "success",
  "output": {
    "result": [
      {
        "text": "Customer Success",
        "value": "6294cd45bb83f36eae2db4b0"
      },
      {
        "text": "HR",
        "value": "6294cd2e0604a64feb7c326f"
      },
      {
        "text": "Marketing",
        "value": "5f36aedb0ec0e166c75bff88"
      },
      {
        "text": "Sales",
        "value": "6294cd2218fc875335ca186d"
      }
    ]
  }
}

Putting it all together

The following diagram illustrates how you would make use of these calls in an application which allows an end user to:

  1. Choose the service (Trello)
  2. Choose the operation (Create New Card)
  3. Choose the board (Marketing)
  4. Choose the list (To do)
  5. Add the new card details

trello-create-new-card-full-diagram