Skip to main content

How to Generate Certificate on Google Form submit

Form Notify - Email Notification add-on allows you to generate PDFs ,certificates and other professional documents.

You can either watch the embedded video or continue reading below .

What are workflows anyway?

Workflows are a set of activities that need to be executed in a predefined sequence to complete a process. For example, generating a pixel-perfect invoice or PDF, sending an email, or transferring data to another system when someone submits a form.

How to Create a Workflow

After installing the add-on, click on "Setup Workflows" to launch your Workflow window. From there, you can create a workflow by clicking on "Create Workflow."

Activities in Workflows

Currently, only one activity (Export Activity) can be created per workflow. This activity helps generate pixel-perfect PDFs, including invoices, newsletters, or any professional PDFs.

How does Export Activity work?

  1. Define Template: Define a template in a Google Doc where any dynamic parameters can be replaced through expressions supported by Form Notify.
note

Avoid special characters like curly braces {} in your form Question .Having them may not work if you use them in expression since expression itself is defined using them.

  1. Create Output Folder: Determine the folder where you want to create the PDFs when someone submits a form and create it accordingly. It's best to separate the template and output folders under a single parent folder.

  2. Design your Activity:

    • Select Template and Output Folder: Choose the template and output folder.
    • Subfolder: Optionally, create a subfolder per form using expressions like {{Form Name}}.
    • File Name: Define the name of the generated PDF using expressions. Make files unique with {{Form Name}}-{{Response Id}} or similar.
    • Sharing Options: Configure file sharing options.

Once configured, the workflow will execute automatically each time a form response comes in.

How to test a Workflow

Test the workflow execution from the "Replay Past responses" menu. Replay a response and verify that it generates the required PDF file in the configured output folder with the given sharing options.

Conditionally execute a workflow

Just like Emails can be sent based on certain dynamic conditions , workflow can also be executed if a certain condition satisfies.Please refer to Send emails on condition to learn more about conditions.

Embed Dynamic Image

You may need to embed an image uploaded by form respondents dynamically. Here's how:

  1. Folder Permission: Change the folder permission where uploaded images are stored to "Anyone with the link" and only Viewer.

  2. Embed Image Tag: Use the tag syntax {{ Embed Image, form field name / http image url, optional width, optional height }}.

Examples:

  • {{ Embed Image, image }} - Form field question name for File Upload.
  • {{ Embed Image, https://i.imgur.com/VW8rUE7.png, 60, 70 }} - Embed a static public image with width and height.
  • {{ Embed Image, image, , 250 }} - Adjust only the height.

Embed Bar Code

Follow the below instructions for generating Bar code .

Basic Format to be used inside Template Document =Barcode(data)

note

Use the formula in a completely separate Paragraph without any text.

Examples: =Barcode(abc124n56) , =Barcode({{Form Field}})

The above formula by default uses code 128 Format and should satisfy most of the requirements if you do not have a special barcode format requirement .

Full List of Parameters to customize

=Barcode(<data>, type=code128 ,barWidth=1, barHeight=50,showHRI=true ,bgColor=#FFFFFF,color=#000000,fontSize=10)

  • Use barWidth and barHeight to customize the width and height of bars .Default value for barWidth is 1 and barHeight is 50

  • You can specify the type of barcode you want to generate using the type param .The default value is code128.As of now values supported for type are one of code128, ean13,ean8,code39,upc

Logical constructs

Introduction

This feature allows you to customize the content of PDF generated. You can define conditions that will determine which parts of the Document Template are included in the final PDF.

Structure of codeblocks

The code used to customize email content is structured using code blocks with the following format:

{%codeblock%}
{%condition%}
<!--This is where you will write the JavaScript code that defines the condition for including the content-->
{%endcondition%}
{%result%}
<!--This is where you will write the content that you want to include in the email.-->
{%endresult%}
{%codeblock%}

Meaning of each section of code blocks

  • {%codeblock%}: This marks the beginning of a code block.
  • {%condition%}: This section defines the condition that will be evaluated to determine whether to include the following content in the PDF.
  • {%endcondition%}: This marks the end of the condition section.
  • {%result%}: This section contains the content that will be included in the PDF if the condition evaluates to true.
  • {%endresult%}: This marks the end of the result section.
  • {%endcodeblock%}: This marks the end of the code block.

Sample code blocks

Here is a sample code block that checks if the answer to the question "Age" is greater than 18 and includes a specific message in the PDF if the condition is true:

{%codeblock%}
{%condition%}
{{Age}} > 18
%endcondition%}
{%result%}
Age is greater than 18 so you are seeing this result.
{%endresult%}
{%endcodeblock%}

Here is a sample code block that checks if the answer to the question "Name" has a lnegth greater than 5 and includes a specific message in the PDF if the condition is true:

{%codeblock%}
{%condition%}
var x = '{{Name}}';
if(x.length> 5) return true ;
else return false;
{%endcondition%}
{%result%}
Name length is greater than 5
{%endresult%}
{%endcodeblock%}

Here is a sample code block that read a check box Question "CB Answer" It reads the answers in a string and evaluates the answers.If the answers are CB1 and CB3 it evaluates to true

{%codeblock%} 
{%condition%}
var x = '{{CB Answer}}'; let cbAnswerArray =x.split(','); if(cbAnswerArray.at(0) == 'CB1' && cbAnswerArray.at(1) == 'CB3' ) return true ;else return false;
{%endcondition%}
{%result%}
two check boxes with answers CB1 and CB3 are present
{%endresult%}
{%endcodeblock%}

Things to Note about condition block

  • Condition block must evaluate to a boolean value .
  • You can use single line statement like {{Age}} > 18 and it will be true if Age is greater than 18.
  • In multi line code you must return a boolean value.
  • You can write javascript syntax.
  • We impose certain restrictions on what functions can be used which is mentioned below.
  • Only if/else and for loops are supported.

Content inside result block

  • You can have any content between the {%result%} and {%endresult%} .
  • The formatting will be preserved
  • You can also insert images inside the result blocks.

Supported Question Types and how Answers are read

  • Only short Answer,Linear Scale ,Multi Choice and Checkboxes are supported.
  • Becareful about empty or non answered questions.
  • If you want to use a Question for condition ,it's a good idea to make it mandatory.

Supported Global Functions

The following global functions are currently supported for use in conditions:

  • parseInt(): Parses a string argument and returns a whole number.
  • parseFloat(): Parses a string argument and returns a floating-point number.
  • isNaN(): Determines whether a value is an NaN (Not a Number).

Supported String Functions

The following string functions are currently supported for use in conditions:

  • split(): Splits a string into an array of substrings.
  • repeat(): Returns a new string repeating a specified value a number of times.
  • reverse(): Reverses the order of the characters in a string.
  • trim(): Removes whitespace from the beginning and end of a string.
  • concat(): Joins two or more strings.
  • toLowerCase(): Converts a string to lowercase letters.
  • toUpperCase(): Converts a string to uppercase letters.
  • substr(): Extracts a section of a string.
  • substring(): Extracts a section of a string.
  • indexOf(): Returns the position of the first occurrence of a specified substring in a string.
  • lastIndexOf(): Returns the position of the last occurrence of a specified substring in a string.
  • startsWith(): Checks whether a string starts with a specified substring.
  • endsWith(): Checks whether a string ends with a specified substring.
  • length: Returns the length of a string.
  • includes(): Checks whether a string contains a specified substring.

Supported Array Functions

The following string functions are currently supported for use in conditions:

  • join(): Joins the elements of an array into a string.
  • at(): Returns the character at a specified index in a string.

Important Notes

  • For security reasons, the use of certain Java Script APIs and functions is restricted.

Pausing Workflow

Pause a workflow from the workflow main page. You can also delete a workflow.

Tracking Generated Documents

If the form has a Google Sheet for responses, the same sheet will be updated with a document link against each response.

We're excited to introduce this new concept and will be adding many more features under the workflow in the future. Reach out to us for further info!