Gmail pack automation fails with most of the mail address types

Hi. I’m having a huge problem with the gmail pack. None of the older threads solve this I’m afraid. I hope some of the clever people here can spot the problem. I’m about to pull my hair out.

I have two columns of buttons that each send a mail with the same shared account, with similar formula for sending. Both buttons are triggered with Automation. One button fail, but only with automation.

This is the log for the automation that fails. Notice that it used to work earlier today. I have not done anything with the automation, and very little of significance to the buttons.

The following examples are in Norwegian, but I think you should be able to spot the similarities anyway.

“Send Svar” button send mail to the mail address in the “Mail” column (mail type) directly added from a form. The “Send Varsel” buttons send mail to the organizations mail address in the “OrgMail” column (text type).

The type of the column is the only thing that really differenciate things here. I can choose plain text or mail type on the “Mail” column, but I have only the choice of text type for the OrgMail type, as that is a lookup to another table that picks up the mail address for the organization. And that one works.

It does not work if I change the Mail column to a plain text type either. The 3 results in the “Svar - Resultat” column is a result of manually pressing the “Send Svar” button. That works well each time, but not automating the same button push. I have verified that mail are sent every time.

Here’s the button setup for both.
Not working (Send Svar):

Formula:

Working (Send Varsel):
Only the formula part will make much sense here.

Additional problem solving:

  • tried to set the automation as the current user as well as the automation bot.
  • ensured that the account can be used for viewing AND taking action.
  • reconnected to the gmail account
  • checked that mail addresses are valid

I’m so puzzled by this. I do not understand at all why I can run it 100% of the times when I push the button manually, but when I automate it it never works any more. This is a picture of the simple automation. The first one fails. The second one always work.

Failing:

Working:

Anyone have some idea as to what is happening here? I’m at a loss. This is the last error that stands in the way from launching a 2 year long coda project :frowning: I can’t simply restore from earlier either, as I have lots of cross-doc tables to other docs. All of those has to be reestablished. It would take to much work to fix.

I’ve narrowed it down. I copied the exact same formula that worked, to the failing button column. Then it worked. Slimmed down the formula to the basics, switched out the mail columns and then it failed again.

So, it has to be one of the mail columns that the automation can’t handle. But I don’t understand why.

Here’s what I got so far.
The failing “Mail” column has the following details. This is a field from a form. It’s just a link.

The working mail column is a text field with the formula “By.OrgMail” as shown here.

The “By” (City) column is a lookup to “DB Organisasjoner” table with the following data. The related OrgMail data is the most relevant that is used in the working Button and automation.

It seems that when the mail values is a lookup object, it can be used to send. But if it’s just a link then it can’t be automated, but it CAN be run manually.

However, when I tried to make a lookup from the Mail column to a new column it also failed. Even though it looks up the data from another colum an present it as an object.

What the actual f is going on?

Hi @Carl_Haugen :blush: !

What happens if you convert thisRow.Mail to text (in your MailSend field) ?

thisRow.Mail.ToText()

Because…

I think it’s not the fact that you gather the email from a row reference but mostly the format of the value it returns that could matter here (which is a simple text value (a list of text values to be precise, from what I can see in your screenshot with the OrgMail field :blush: ))

But, the field formatted as Email might have underlying info which might not play well with something, somewhere (there’s an icon, etc…) :innocent:

Thanks for chiming in again , @Pch !

I’ve tried the ToText() functions before with no luck. I’ve also removed the icon for the mail field type, set the field to text only, as a lookup from another column and so on. Nothing matters it seems. You can see the new attempt with ToText() function here:

The first button row works manually, but still fails with the automation like this:

At 10:44 AM I tried to use the “OrgMail” column as address, and that flies through. Just tested again now with the same positive result. What I see when hovering over the addresses in the “OrgMail” column is that they show not only text but also a link. Even though the field are set as text type.

Here’s an image of the working column:
image

I can’t understand why the Gmail pack or automation should be so picky as to what type it supports.

I was hoping it would be just a mismatch somewhere :innocent:

But from the screenshot with the details of the error you get in the Activity of the automation, it seems like the Automation Bot simply can’t send an email through the Gmail Pack (at least, that how I understand the error message).

At the bottom of the automation you should find a “Take actions as” menu/dropdown to select “who” runs the automation and performs its action(s).

Per that menu/dropdown, the Automation Bot can’t use “private Pack accounts” … Which I guess could be the problem here :blush:

I could still be wrong though :innocent:

1 Like

That worked! But not when I tried it several times yesterday. Typical :slight_smile:

Only reason I can think of is that I changed the mail column to some kind of type or formula that was not supported, at the same time as I tried to change the automation settings to Take action as the admin account and not the bot. Now it even works with the original mail column.

I should have tested more with the “take action as” options, as it was clearly mentioned in some of the errors as well as it was mentioned in previous threads. Oh well. Perhaps next time.

Thanks for the help again, Pch!

My pleasure @Carl_Haugen :grin: !

I’m very glad to know everything’s working as expected now :raised_hands: !

1 Like

I were too quick to celebrate :frowning: The automation broke down again a couple of days ago. No matter what I did, the mails did not fire from the automation, but worked perfectly with manual push of the buttons.

When I tried to switch from the automation action “on form submit” to scheduled every hour, it worked great. Have been working for at least 24 hours now. So, I suspect there is one of three possible culprits here.

  1. The form submit function that the gmail pack is using are not that reliable.
  2. Or the underlaying functionality for the form submit in coda is somehow buggy
  3. OR something fishy is going on with the gmail service.

As gmail has been around for so long and it’s such a big service, I doubt that it’s google fault. I would guess it’s a higher likelihood that the pack author has made a mistake. The best way to get to the bottom of this would probably be to contact the pack author, right? Or maybe coda support would be a better starting point?

Might be googles fault. They are crazy

Want to share your doc? Happy to take a look - I’m actually making a new gmail pack right now so have been deep in their APIs

But current pack maker is Coda themesleves, so support should also be an option

1 Like

Thanks @Scott_Collier-Weir

I’ve created an identical test doc for this. It’s button formula for sending mail is a bit simpler, but all functionality that previously failed are there. Don’t really want to share the original, because it contains so much stuff and it would be a small disaster if something happened. Even with a rollback.

Unfortunately the new test doc works now though. I’ll try to test this every day and give you an heads up if I see it failing again.

I’m not sure if you can see and edit the automation rules if you just got edit rights. I’ve opened it for everyone with this link. Tell me if there’s more you need.

Hello @Carl_Haugen

Have you tried this in your automation:
RunActions(thisRow.[Step 1 Result].[Send Mail])

Greetings, Joost

1 Like

I have not, @joost_mineur. It only had the “RunActions([thisRow.[Send Mail]])” formula. That’s what was created when i used the wizard-ish thing for the automation.

Would that be enough to confuse coda as to what row needs the button pushed? Not using the Step 1 Result? It works about 50% of the times. A series of tests work fine, then in some time they all fails, then it works. It can go a few for days between issues.

I thought that the automation formula of the button would suffice, as long as the Form submit automation picked up what row it was. Here’s the Button formula.

ModifyRows(thisRow, [Form Response].Result, Gmail::SendEmail([org@mail.com)], thisRow.Email, “New Subject”, Concatenate("Hey, ",thisRow.Name, ". ")))

Adding the Step 1 Result to the automation also worked in the test doc. The main doc with the original issue works well now, of course. So, I’ll have to check later if this problem reappears. I can add the code to automation then to see if that does any difference.

Hello @Carl_Haugen ,

What is the wizard-ish thing? If I understand you correctly, yes, Coda helps writing your CFL, but it is not going to prevent these type of problems (obviously), because your code is not wrong, it is just not right for what you want it to do.

The THEN part of the automation does not know which row to use, so it will push all buttons in the column.

That might work, or it might run into an error and stop executing and show an error in the automation report. If your test button has fired, you think you are doing OK, but in reality, it might run into an error in another row (but you would never know). I can’t look at your ‘real’ doc so I am just making assumptions, but for sure, an automation that is being triggered by a row change needs ‘step 1 result’ to taker action in the row that triggered the automation.

Because while testing you have probably a limited number of rows, things seem to be fine, but as the number of rows grow, you will run into problems if the automation is not 100% correct.

Happy coding,
Greetings, Joost

By the wizard thing I just meant the initial form of When, If and Then for the automation. I did not use the formula directly. So, I kind of just expected it to work. But I think you are very correct in that the Then part have to have the step 1 result for it to work reliably. Because I suspect that the errors mainly have started after quite a few rows of test data in the table.

I’ll add that to the original automation and see how long it last until it breaks. I hope never :slight_smile: Thanks for the tip!

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.