Display custom message after submitting a Google Form - google-apps-script

I have a Google Form that allows user to enter their information. After they submit the form, the data is inserted to a Google spreadsheet as a new row.
However I want to show a dynamic message right after the form is submitted, overriding the original "thank you" message. The new message would display the information they just filled in, with an number assigned to him.
For example, Mary filled in her data and submit the form. Since Mary is the 5th person to submit this form, the message shows her number as 5.
Is there any way to achieve this? I have been studying Google App Script and HTML service but I am not sure if this is the correct way.
Please note that we have already using email to send out this message for several years however user strongly suggest that showing their ID right after form submission would make lots of things much easier.
Thank you very much!
Update
I have been working on it and now I am able to make a web page that inserts a new row to a spreadsheet. But another question: How to publish the web page? When I open the "/dev" link it works fine; However when I open the "/exec" link it says cannot find "Index.html" and I am sure there is a file called Index.html.

There is no way to add a custom confirmation message for the current user of the currently open Form. You can run code to change the confirmation message when the Form is submitted, but changing the confirmation message when the Form is submitted won't take affect until the NEXT Form is opened, and that's too late. So the next person to open the Form would get the confirmation message of the previous user.
You would need to convert everything to a stand alone HTML App for something like that.

Google just released a new version of Google Forms. In the settings you can change the confirmation page message for respondents. You can save a link to a web page in the custom message. So if you can create a web page with the data you want displayed, you should be able to save the link in the custom message.

In order to achieve the above-mentioned goal, you need to get the Google form on your web page. No, I am not talking about embedding the form to your web page but to create a stand alone HTML page. The reason behind doing so is since Google is a third party website, editing any code in Google forms is not possible and there is no other way (at least I could not figure out Yet) to place custom thank you page URL for the Google Form. You can even remove certain codes in your HTML page to make sure it doesn't look like or says Google form. Basically, to have custom URL you need to replace
Code to be replaced for custom Thank you url in Google form
In case you are not a techie, Playing with codes might break the code.This step by step blog for customising Google form might help you.

Related

How to display a customized webpage using Google Web App?

I'm trying to write a web app, such that when a user fetch his/her username to the web app, the web app will retrieve the data stored previously in a Google Sheet, and construct a form (webpage) based on the username. What I mean is, each username will have different contents to work with.
The problem is, I just cannot get the page to display; it just shows up for a second, and a warning sign just appears, and this makes my webpage looks so suspicious, while in fact, it isn't.
Here's the part of the code to show up the webpage:
The code above checks if it's the first time the user comes to the page, so a welcome page should be loaded, then he/she can continue from there.
And here's the page after a blink of an eyes:
What I want to ask is, is there a way that I can load a page based on the username given? I don't really know what I am doing wrong. :<
Thank you guys so much in advance.

Alternative to mailto: to link email

I am creating a website and there is a page with people that are part of the company. Each person has an email that i want for the user to be able to get the email for the person that he/she want.
If we were in 2011 i would have used mailto: html tag. But really not so many people are using desktop email clients.
I thought about linking to a link so a new window would open in gmail and a new message would be created with recepient the pressed email. BUT not everyone uses gmail.
The only posible "solution" that i though that when the user clicks on the email this would be copied automatically in the clipboard. It would have the same result as doing CTRL & C at something. BUT this requires a lot of time and i dont want to get my hands dirty with javascript.
Is there any other way to do this ?
You should probably still use mailto:. mailto: is not intended for just desktops, it identifies a handler for the client. A mobile device would be able to recognize it just as well, and launch its preferred MTU.
With a lot of addons like smartaddon contact form and foxyform available out there, you could add them to your html code.
But, if you could use php, it to would just take few statements of code to set up the contact form on your own. Refer this post which explains clearly on how to set up your contact form using php.

How to embed Google Compose Mail window in to Google Sheet Form?

I won't bore everyone reading this post with the entire background story of why I need to do this. However, I am looking to load the Google Compose Mail page in the HTML form loaded inside a Google Sheet I have created.
I know the link for the Compose email is https://mail.google.com/mail/u/0/?view=cm&fs=1&tf=1&to=TO&su=SUBJECT&body=BODY
But I don't know if it is possible to have this link loaded as a view in the HTML service Form.
Does anyone know if this is possible and if so, how to do it?
I could always have a button to load the link in a separate tab... but I would like to have this all kept on screen to be more "professional" looking.
I was looking for an option to add an iframe or free code, but option exists. I recommend inserting a form if you are looking for a way to get data from users.
Its under "Insert", then "Form..."
Good Luck

How to Add Hyperlinks to Google Forms user Google Apps Script

I'm trying to use Google Apps Script to add hyperlinked rows to a GridItem, ideally that act as tooltips. Am I trying to do more than is possible with Google Apps Script?
Here's the situation: I have a GridItem type question that has lengthy row descriptions. To clean up the interface, I'd like to present a short summary of the description that, when clicked/hovered, reveals the full text. To do this, I'd need to turn the short summary into a hyperlink. However, I haven't seen any way to insert hyperlinks in GridItem rows. I thought that Google Apps Script may allow me to do this.
So far, I've tried entering a string followed by .setLinkUrl(), using createAnchor('text', url), using markdown, and actually inserting, as text, <a href='http://google.com'>Google</a>' for the row. Nothing has worked so far.
Is this possible at all?
EDIT:
I apologize - I didn't research this question well enough before posting. Turns out Google Forms auto-detects URLs and posts them as links in the live form. I still have an issue with this, though - I'd rather have some specified text displayed to the user instead of the URL (some of my URLs are lengthy). Anyone know how to do this?
You can design the main elements of the Google form the normal way. Then preview the live form, copy the generated html file, hosted in your website.
Then you can replace the <a>...</a> tag that is generated by Google Form by one you need e.g. <a href='http://google.com'>Google</a>
keep sure you don't disturb any styles or code that may be needed by the Google form to work.
This solution need to have your own web hosting.
You will need to point your users to your website not the live form preview.

Google App Script: Run script from within another script?

I am working on a payroll web app for my company. I was wondering if there is anyway to run a script from within another script. Such as having a hyperlink or something similar that the user could go and see a different UI and everything. If this is not possible, does anyone knows how to submit a copy of a html form to an email? I been trying to do this but GAS removes the styles and the JavaScript code that fills the form before sending it. I just need at least an image of the form so the manager could print it out and sign it.
Thanks
Yes, you can link from one script to another using regular anchors.
It's not Apps Script stripping your emailed form of this stuff. Email clients, including Gmail, intentionally don't support complex HTML. If you want an image, try creating a Google Doc with the DocumentsApp, converting it to pdf with document.getAs("application/pdf") and then emailing that.