Trello provides api that can be integrated in google scripts so that if something happens in spreadsheet, we can create/modify cards in appropriate boards. Also zapier provides similar sort of integrations.
But is the reverse possible? ie if some new card gets created or modified, it gets pushed back to google sheet.
I could not find in their api if they have some sort of a listener that listens to card created/modified event(please correct me if I am wrong). So was thinking of alternative ways to do the same.
Here is a workaround:
Google Apps Scripts can be published as webapps. You can use the built in functions doGet() and doPost() to receive GET and POST events to your webapp. I haven't setup Trello specifically but I do use this to setup webhooks for github.
Here are the docs on pubishing your script as a web app
https://developers.google.com/apps-script/guides/web
The docs will state that you must return an htmlService or contentService object from a doPost() or doGet(). Most webhooks are looking for a response code, you can simply do a ' return 200; ' That works fine.
note: missing from the docs is how to access the post body.
function doPost(e){
var postBody = e.postData.getDataAsString();
// Do something with the postBody Data
return 200;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.