Expressions
Form Email Notifications supports expressions which will help you customise and send dynamic data as notification.The syntax for the expression is of the form {{ <some value>}}.Form Email Notifications supports two types of expressions namely static expression and dynamic expression.
Static Expression
The static expressions are pre defined expressions available to each form .List of supported static expressions and their meaning is given below.For example if your form name is "Customer Feedback" you may use "A new response for {{ Form Name}} " in the processor Email Subject field and it will be evaluated to A new response for Customer Feedback as the email subject.
List of Supported Static Expression
{{ Form Name }} : Current Google Form Title
{{ Form Publish Url }} : This is the Url that your users will use to submit a response
{{ Form Edit Url }} : This is the URL form owner and collaborators use to edit the form
{{ Form Id }} : Unique Google form Id
{{ Response Edit Url }} : This is the URL the respondent can use to edit the already submitted response.
{{ Response Summary Url }} : This is the form response analytics URL
{{ Response Id }} : This is the unique form response id
{{ Response Date }} : This tells when the form response was submitted
{{Marks Scored}} : This is the total quiz score of a candidate .Works only if the form is a quiz.
{{Total Marks}} : This is the total points possible in the form.Works only if the form is a quiz.
{{Percent Scored}} : This is (Marks Scored)*100 /(Total Marks) rounded to two decimal places.Works only if the form is a quiz.
Note: The expressions {{Marks Scored}} {{Total Marks}} and {{Percent Scored}} exclude Grid (Multiple choice Grid and Checkbox Grid) type questions as they are not exposed by Google
{{ Only Answers }} : This will contain a HTML table and have the questions and answers for those which were answered .If you have five questions in a Google form and only three of them were answered then this HTML table will contain only those three questions and their answers.
When you opt to include a PDF attachment in your notification Email ,Form Email Notifications will use the output of this expression and convert this to a PDF.
{{ Everything }} : This will contain a HTML table and have the questions and answers for all the questions irrespective of they were answered or not .If you have five questions in a Google form and only three of them were answered then this HTML table will have all the five questions and the three answers .For questions that were not answered this will have blank values.
=QRCode( data or expression go here hexcolor(#ffffff,#000000) ) : You can now generate and embed a QRCode in Email body .The basic format is =QRCode( data or expression go here ) .If you want to include an expression you can use =QRCode( {{ Response Edit Url}} ) . If you do not pass hexcolor params the default background color is #ffffff (white) and foreground color is #000000 (black) .You can pass customer background and foreground color using hexcolor(hex background code ,hex foreground color code)
=Calculate(expression go here): You can now use this function to do basic calculation.
Some Valid Examples:
=Calculate(2+3 * ( 4-1 )) : Will produce 11
=Calculate(2+3 * ( {{ CalcValue }} )) : Will produce 17 assuming someone enters CalcValue as 5 during form submission
=Calculate( {{ CalcValue }} * {{ CalcValue }} ) : Will produce 25 assuming someone enters CalcValue as 5 during form submission
=Calculate( abs(-4)*round(10/3)*{{ CalcValue }} ) : Will produce 25 assuming someone enters CalcValue as 5 during form submission .
As of now only abs and round functions are supported.abs will give the absolute value and round will round it to the nearest integer .
Some Examples of abs:
abs(8.35) = 8.35
abs(-8.35) = 8.35
abs(5 -7) =2
Some Examples of round
round(5.4) =5
round(5.6) =6
round(5.5) =6
Tips
Use expressions {{ Only Answers }} and {{ Everything }} only inside Email body .They will not work anywhere else.
Dynamic Expression
The dynamic expressions evaluate each form field and will include the actual response to the question.If you have a short answer question in your google for that asks What is your name then the expression for this will be {{ What is your name }}
Tips
The good thing is Form Email Notifications shows the full list of Static and Dynamic expressions in two different drop downs under the toolbar as part of Email Body inside Processor Editor as shown below .
You can select the required expression automatically with in Email Body .However in other fields such as TO ,CC,BCC, and Subject either you have to manually type the expressions or copy and paste them from Email Body.
Only fields TO ,CC ,BCC ,Subject and Email Body support expression.