Introduction
In this post we will be exploring a proof of concept to write card names between Trello and Google Sheets. By using WayScript the solution is clean, easy, and seamless between the two platforms.
Prerequisites
You will need a Trello account and board and a Google account and Google Sheet to work with. To learn more about this please us the following resources
Since we will be using two triggers we should create a second function by clicking the ‘+’ in the top left of WayScript interface
Let’s also go ahead and import the Google Sheets and Trello packages by using the libraries tab
For this post we will also Create Variables and use the Python module, If, and Print to Log modules
- Working with Create Variable
- Working with Conditionals
- Working with Python
- Working with Print to Log
Getting Started
Let’s get started by adding a Google Sheets trigger to trigger on new rows in our sheet to our left function
Create Boolean
We’re going to create a toggle variable to easily toggle if the card name doesn’t exist in Trello
Search Trello Cards
We need to get existing Trello cards to avoid duplicates
Python Check for Difference
Nice Python one-liner which creates a list of differences from two lists without iteration and changes toggle to true if differences exist (easy way to check if card doesn’t exist in Trello)
variables[ 'card' ] = list( set( variables[ 'Row_Data' ) - set( variabled[ 'Card_Names' ] ) ) if variables[ 'card' ][0]: variables[ 'toggle' ] = True
Check Toggle
We add an If condition to check our toggle state
Create Card (True)
If toggle is true then create Trello card
Print to Log (False)
Card already exists in Trello
Trello Trigger
Now that we have the Google Sheet trigger function we need to create the Trello trigger to insert rows into Google Sheet from Trello
Since, we will be needing an output we will need to modify Trello advanced settings
Create Variable
We are going to create a List variable as a placeholder for our Google Sheet row
Get Card Name
Again we will be using some easy Python code to parse our JSON data and append to our Google Sheet row data
import json data = json.loads( variables[ 'JSON_Data' ] variables = [ 'trello_row' ].append( data['action']['data']['card']['name'] )
Write Google Sheet
Let’s write our card name from Trello as a new row in Google Sheets
Result
You should now be able to create rows and cards to/from Trello and Google Sheets
As always, if you have any questions, comments, feedback, or suggestions, please let us know on WayScript or through our discord. If you would like to view this WayScript simply follow the link Trello Cards and Google Sheets.
Top comments (1)
👌Awesome job, Derrick! 👏 Integrating Trello cards with Google Sheets is a game-changer for productivity. Thanks for the step-by-step guide and the helpful tips on how to customize the integration. Can't wait to give it a try! 💻📊👍
👀 Recently, I stumbled upon an 👌 article about integrating 🚀 Salesforce with 📌 Trello! It's a complete guide 📖 that covers all the methods 🛠️, step-by-step instructions 🧭, benefits 🌟, and best practices 🏆! Check it out: Salesforce to Trello Integration