Creating a Card in Trello
In this example, we will demonstrate how to use the Execute JavaScript functionality to make a request to the Trello API, aiming to create a new card in Trello. The automation will be configured to capture data from a newly created order in Reportana that contains a specific product.
Based on this data, a request will be made to create the card in Trello, containing the relevant order information.
Example Using the Trello API
- First, we use the Order Created trigger together with the condition Product(s) → Contains → “Exclusive Product”. This means that whenever a new order is created and includes an “exclusive product,” the automation will be triggered to automatically create a new card in Trello using the Official Trello API.
- Next, if the created order contains the “Exclusive Product,” we will trigger the request to the Trello API in Execute JavaScript, as shown in the code below:
Notes: In this code, we capture the “name,” “phone,” and “order number” data related to the order to specify these details when creating the card, following the Trello API usage guidelines. Additionally, to use the Official Trello API, you will need to obtain the API Key, API Token, and the ID of the list where the card will be created. For more usage instructions, we recommend accessing the Official Trello Documentation: Official Trello API.
- Once the card is successfully created, our automation structure is configured to send an informational message to our own WhatsApp number, using the “Send to another phone” message option. The same applies if the request fails.
Card created in Trello, as shown in the example:
To obtain the API Key, API Token, and List ID credentials, access: Official Trello API and follow the usage instructions. If you prefer, translate the page in your browser to facilitate reading.