Notification (email) when forms submitted

How people keeping track of Form submissions? Is there any way to be notified when a form is submitted?

Thanks

Not anything native to Glide or Google Sheets but you could write a script to do it. Sending the actual email is pretty easy. https://developers.google.com/apps-script/reference/mail

      MailApp.sendEmail({
        to: "youremail@whatever.com",
        subject: "New Form Added",
        body: "This is the body of the email."
      });

What you would do is set up a timed trigger that runs a function that checks for the additional row that a Form added. You would create a column that holds a true false, to indicate that an email has been sent or not. Jump to the last row and check that flag, and if it false, just send the email. Then change the flag cell to true. You could include anything in the email from that sheet row so you would have an idea of who filled out the form if you saved emails or other info.

3 Likes

Thanks for that information. Is it possible to provide some guidance on what the function to check for additional rows would look like? I havenā€™t had to delve into Scripts yet but do have some Javascript knowledge.

@kyleheney If you know javascript you are way ahead of the game. Google script is basically a clone of Javascript.

I put together this bare bones spreadsheet and script as a demo.

Make a copy and give it a try. Go into Tools/Script Editor. Then run it using the debugger (icon of a bug). You can set up breakpoints by clicking just to the left of the line numbers. You will see a red dot. If itā€™s the first time trying a script search YouTube for a short beginner tutorial.

You will have to authorize the script by going through a few screens and warnings about it being able to access your spreadsheets and email. Since you are the owner of the script and know what it is doing just keep allowing it.

Let us know how you make out.

4 Likes

Thank you very much for the help and the demo. This is a great starting point for me.

1 Like

Thanks for this demo George - I made a copy of it replaced the email address cells and it worked perfectly!

I donā€™t know much about JS but wanted to know how can I improve this script so that an email is sent to all those that have commented on a post including the original author of the post?

I can see that Glide creates a sheet called ā€˜App: Commentsā€™ which lists all the comments created, it also has a reference to the original ā€˜Topicā€™ that can be used to fetch the email of the original author.

@Rogelio Glad it worked for you. Wellā€¦ What you want to do can be done but there are a few things you have to consider. The code to send emails is already there so nothing major needs to be done there. As part of your design you need to answer these questions, before you even begin trying to code anything.
What will be the trigger to send these emails?
Would they be send one time only?
Would you want them to be send each time there is a new comment?
Would you the send all the comments and original post each time?
Where would you store the fact that an email was sent already?

Once you have a clear picture of what you need to do, you would take one step at a time and write a function to accomplish each one that is needed. It most likely would involve a fair amount of code and setting up some kind of storage on a sheet so you know where you left off, so when a new comment comes it you can react accordingly. There is a lot to think about and a not of moving parts to consider. It may seem simple but it can get complex very fast.

I want to take the simplest approach -

  • Trigger: On Create(tion) of a new comment
  • Frequency: Every time a comment is created
  • Recipients: All that have commented on the same post in addition to the author
  • Content: a generic message like: ā€œsomeone has commented on your post. Click link to view + a URL link to the post which opens the App and brings up the post (if possible)ā€

I see this being executed in two steps.

Step 1: When a new comment is added to sheet ā€™App: Comments' a script would run to scan and get all other comments made to the same Topic grab the Email and copy it to another sheet which will list all the emails that need to be sent (similar to the ā€˜Emailsā€™ sheet in your demo)

Step 2: Would be your demo script which will then send an email (with the generic body) and mark if sent TRUE or FALSE

I need assistance with Step 1, when a comment is created a script needs to run and for every other row if the Topic (ā€˜keyā€™ which is creation date) matches with the newly created comment then grab the Email from the corresponding column and copy to new row in sheet Emails - your demo script will do the rest I would only need to update so that it triggers On Creation of a new row also.

Have you done any testing regarding what happens now? Iā€™m not sure of what the trigger is now but when I released my app about 6 months ago there were some emails that were sent to people who had commented. I donā€™t know the mechanics of it nor if it is still happening since I havenā€™t seen a new comment in a long time for my app. So I would create a few test email accounts if you havenā€™t got a few already and post some comments and see.

This is straight from the Glide docos - whatā€™s not clear from the docs is that, does everyone that has commented earlier receive the email? or just the author of the original post? also, the email notification of a new comment is at most sent only once per day.

I am yet to see any emails notification of new comments. In one of my original posts, there has been at least one comment from another user and I never saw an email notification.

Is this even working?

From what I remember everyone does receive an email of they have commented as well. As for the original author, Iā€™m not sure what you mean by that. The original author in my case was me as the programmer when I set up the 3 comment topic categories for my app.

as in, If I created the original post, makes me the original author, therefore I expect to get an email notification that some other user has commented on my post.

I have created a post in the past in which another user has commented on but I never received an email notification to say that a new comment has been made to my post.

I guess we are using comments in a different way.
So what is your stumbling block with your script so far?

BTW I hunted down an email that I received last month. I did also get a report from a user that they have been receiving emails on the posts that they participated in. Here is what it looks like:

ah Iā€™ve never received such an email -

question: was that a notification of a new comment on an item which you originally created?

Yes that was the last notification I received. I created 3 feedback comments in my app, this one was titled ā€œGeneral Feedbackā€ Take a look at the last record of this sheet. That was the comment that triggered the email.

Yeah I see - well theyā€™re not working for me for some reason.

What field/column are you using as the key?

Im guessing that in your comments component youā€™ve selected what ever the column which relates to ā€˜General Feedbackā€™?

I am using the creation ā€˜Date/Timeā€™ of the original item being commented on.

@david - Iā€™m not receiving email notification of comments are per the docs, is there anything that I may be missing or doing wrong?

image

I could have sworn that I read something a while back about the email notifications for comments being disabled. I could be wrong. I havenā€™t been able to locate a thread that mentions it yet.

oh so maybe thats why Iā€™m not receiving anything and if thats the case then the Glide documentation is misleading.

Hereā€™s the comment that I saw about the emails.

https://community.glideapps.com/t/please-try-our-amazing-new-menu/589/7?u=jeff_hager