Gmail Pack - Matching threads with crm

Hi Coda Community,

I’m working on a CRM in Coda and have integrated the Gmail Pack to streamline my email communications. My base table (CRM) includes an email field, and I’ve successfully added the Gmail Pack to send emails directly from Coda. This works just fine.

However, I’m struggling with tracking the sending and receiving of emails per contact. Specifically, I’m stuck on the formula to match the threads table with the email records in my CRM. The Gmail Pack records the email as a link, and I’m not sure how to create a formula that matches these threads to the corresponding email in my CRM.

Here’s what I have:

  • CRM Table: Contains contact details, including an email field.
  • Gmail Threads Table: Synced using the Gmail Pack, which records emails as links.

Could someone guide me on how to write a formula to match the threads table with the email records in my CRM?

Any help or examples would be greatly appreciated!

Thanks in advance!

Hi Jonathan

I’m assuming just filtering the Threads table based on the email of your contact is not enough for your use-case. That could be easily achieved by adding an additional column to the ‘Threads’ table to extract the emails from the recipients → thisRow.Recipients.Email

I don’t know if you’ve noticed that the ‘Result’ of the ‘Send email’ action outputs a thread ID. Using the UI you can store it in a column, but you can also retrieve this value within a formula.

I would do the following:

  • Create a new table, ‘Threads per contact’ or something like that with 3 columns:
    • Relation: Contact
    • Text: Thread id
    • Relation: Thread → Formula: Threads.filter(Id=thisRow.[Thread id])
  • Adjust your action in the following way
    [Threads per User].AddRow(
      Contact, thisRow,
      Thread id,  SendEmail( [...])
    )
    
    What happens here is that the email gets sent first and then the result of the action (a thread id) is used to create a new row on ‘Threads per User’
  • Add a Thread relation column to your CRM table → Formula: [Threads per customer].filter(Contact=thisRow).Thread)

That should give you a nice column per contact with all your thread objects.

Hope this helps,

Pablo

2 Likes