- Integrate with Trello API
- Extract data from Trello
- Iterate over the data and filter only the relevant
Configuration config.json was created using AutoFlow version 0.2.5
Is you have questions about this example, feel free to post your question on the community "Ask Questions" website.
- HTTP Server
- Endpoint (Method: GET)
- Action string/join to prepare the URL query with incoming ID
- Action communication/http-request to make the HTTP API call to Trello
- Action json/decode to make the JSON easier to use
- Action data/set to create an empty array for storing the extracted database
- Action iteration/for-each to iterate over the Trello data which is in array
- Action array/insert-at to insert the extracted data into the array
- Action data/set to set the result in the response body
When build API solution, it is easier to mock the data, which makes it easier to build and test the solution.
Here you will notice that we are joining an array with ID coming from the user.
Set the URL to the path that was created from previous string/join action. The query comes from the user which consists of ID, Key, and Token. In our solution, you can simulate that. The returned data is stored in a new variable called "result"
Trello returns the data in JSON format. We can use the json/decode action to put the data in a more accessible format.
Array is commonly used to structure extracted data. Before we iterate over the Trello data, we use data set to delcare/create an empty array.
Notice that decoded Trello data was saved in a variable called "result_decoded". Each element's index and value are stored in index and value variables respectively.
As the Trello data is iterated, array/insert-at action inserts the selected data into the "sorted" array that was created earlier
To make the data available, data/set action is used to set data in the response body.
For Additional help on Trello API: https://developer.atlassian.com/cloud/trello/guides/rest-api/api-introduction/
Get Trello Key (you must be signed in) https://trello.com/app-key