About Button Feature


I have a couple issues with the button feature. As shown in the first screenshot provided, I added a button for each row in the table in the Coda doc. When I click the button, I want to send the data in the row from the Coda doc to a Python file using JSON. However, I could not find a way to do this using the current Coda APIs. Do you have any idea how this can be done?

Coda Doc Table:

Please let me know if there is a solution or a recommendation.

Thank you!

Hi @Jiahn - Welcome to the Coda Community! The Coda REST API is intended to be used in other applications to read and write data to Coda docs. If you want to extend a Coda button to take a custom action, for that you’d need to use our Pack SDK:

Packs can send data outside of Coda, but only to public HTTP endpoints. So if your Python code is hosted somewhere (your own server, AWS lambda, etc) then the Pack can send JSON to it. However if that Python code is on your local machine that won’t be possible with a Pack.

If you need to run the code locally, another option would be to use built-in Coda formulas in the button to set a value in a hidden column. Your Python code could run at a regular interval, check that column, and then take action if a value has been set. It wouldn’t be as immediate as a Pack, but depending on your use case it might suffice.

1 Like

Thank you so much! I will use that :slight_smile: