Can you use the Submit Form as Zapier Trigger

What action do you want to trigger? Would a Google Script work?

I’m going to ask the develop team, but the action I’m looking is to after someone submit the form it would trigger a zap with several actions like e-mail, sms and mailchimp.

Thanks @ThinhDinh!

1 Like

You could always create a Zap outside of Glide…one that’s triggered by a new row in the spreadsheet.

I was actually helping my daughter achieve this for an app she was working on!
:grin: #prouddad

4 Likes

@Robert_Petitto Thanks! But the problem with that is that the trigger for a new row takes something like 3 minutes to actually trigger as I mentioned :frowning: And I really need to supress this 3 minutes delay.

Congrats on Helping your daughter! :heart:

@ThinhDinh I’m sorry, but I would a G-Script work in this particular case? I know nothing about it :frowning:

I have only worked with sending automatic emails based on newly added rows, not sms or mailchimp (but I think SMS will work the same way as long as you have the carrier number’s email format).

Here’s an example.

I use Google project triggers to run google script functions all the time. https://script.google.com/home/

What I normally do is run a timed trigger as frequently as every minute, 5 min, once a day, whatever makes sense for what you are trying to do. From there the Google Script function and pretty much do anything you want. I’ve used it to add new users to Mailchimp, send files to Amazons S3 service, send SMS messages using Twilio, send emails of course via the sheet owners email access functions, but if email limits are an issue I have used Sendgrid to send the emails. Pretty much anything that has an API and sample Javascript code examples, can be accessed via a Google script with the data coming from the Googles sheet. Instantaneous running of a script function is not possible at this time.

But to answer the original question Zapier would not be triggered on a Glide form submit.

2 Likes

Could you talk more about how you implemented this? I need to send text notifications to users based on new rows being added.

I’m also curious how you handle permissions, opt-outs, etc.

Probably @Manan_Mehta can also chime in. He used that for his Pluhg app.

1 Like

Twilio has it’s own Google Sheet integration with Apps Scripts

I am using this and manipulating it in my scripts to achieve what I want which includes notifications on:

  1. Form submission (Addition of new rows)
  2. Status change of row (Editing of existing rows)
  3. Time based (reminders calculated based on status and time)

All of this manipulation has to be done in GSheets. Unfortunately that’s not possible in Glide Tables/GDE yet.
In my app the lag is usually between 30 seconds and 1 min.

3 Likes

Since you know Google Script, can you take a look at my script below? I took the Send SMS from Sheet example from Twilio. I just am not familiar enough yet with google scripts to spot the (likely obvious) error in the code. When I run the script, I get a “no phone number” error from Twilio. One question I have is how does the script know which sheet to use if the sheet is not specified in the script. Thank you for any help.

function sendSms(to, body) {
var messages_url = “https://api.twilio.com/2010-04-01/Accounts/…/Messages.json”;

var payload = {
“To”: to,
“Body” : body,
“From” : “18653250437”
};

var options = {
“method” : “post”,
“payload” : payload
};

options.headers = {
“Authorization” : “Basic " + Utilities.base64Encode(”…:…")
};

UrlFetchApp.fetch(messages_url, options);
}
function sendAll() {
var sheet = SpreadsheetApp.getActiveSheet();
var startRow = 2;
var numRows = sheet.getLastRow() - 1;
var dataRange = sheet.getRange(startRow, 1, numRows, 2)
var data = dataRange.getValues();

for (i in data) {
var row = data[i];
try {
response_data = sendSms(row[4], row[12]);
status = “sent”;
} catch(err) {
Logger.log(err);
status = “error”;
}
sheet.getRange(startRow + Number(i), 3).setValue(status);
}
}

function myFunction() {
sendAll();
}

Do you have an empty row somewhere in the sheet?
Try adding something like console.log([row[4], row[12]]); immediately after the line where you call the sendSms() function, and then examine the log afterwards. This will allow you to pinpoint which row is triggering the error.

Because this…

The answer is that it doesn’t know which sheet to use. It just uses whichever sheet happens to be open (active) at the time, which may or may not be the correct one. Much better to do something like:

var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('YOUR_SHEET_NAME');

Very helpful. Was able to get the basics working. Not fighting through learning how to qualify onChange so it only triggers when a new row is added.

Thank you

Feel free to give a shout if you get stuck.
I’ve done a little bit of work with triggers…

1 Like

Now that you offered…

I am trying to qualify the onChange trigger to run a script ONLY when a new row is added. It currently triggers when a new row is added and when changes are made to cells. I ran across changeType and am stumped on making it work. Relevant code:

function newRow(to, body) {
var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
if(e.changeType === ‘INSERT_ROW’){

Any help appreciated.

Yes, I saw your post in the other thread.
I replied and so did George - did you see the replies?

Hi,

I was looking to do something similar - use the “On submit” action as a Zappier trigger but it doesn’t seem to work even though you technically can select Zapier as an action in the on submit action options. I just want to send a confirmation e-mail to the user once they submit the form.

My question is, will this capability be enabled in future? The answer wasn’t clear to me in the thread so thought I’d ask.

Thanks in advance!

Disclaimer: I don’t use Zapier, so this is just a wild guess…

Have you tried create a custom action, and sending your zap as a part of that action?

Yeah, I tried that and I got an error.

I mentioned it in this topic - Geting errors when Zaps are triggered

I’ve tried setting it up on the submit as a custom action and on its own using the on submit Zapier options but I get the above error each time. I get the same error when I try to trigger the zap on a button so wasn’t sure if i’m doing something wrong or i’m trying to do something that can’t be done yet.

If your triger on a button is also not working, I think the bug hasn’t been addressed yet. I have used Integromat a lot recently so haven’t tried again with Zapier.