{
  "name": "DSP Certificate w/ Google Forms",
  "nodes": [
    {
      "id": "1f3a1bb2-1e5b-4696-aafc-5b3267d76cbf",
      "name": "Google Sheets Trigger",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        -100,
        -20
      ],
      "parameters": {
        "event": "rowAdded",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "REPLACE_WITH_RESOURCE"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "REPLACE_WITH_RESOURCE"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "385f6b0f-2db0-4a44-816c-c6f6c8ccb493",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        620,
        180
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "58a77733-99f1-4884-b955-0a6f6c983cfc",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        -340
      ],
      "parameters": {
        "width": 300,
        "height": 180,
        "content": "### 1) Start here\n* Create a Google Form and then enable quiz mode.\n* Publish it, submit 1 text data.\n* In response section, you'll see \"Link to Google Sheet\" option.\n* Press, and it will create a new sheet."
      },
      "typeVersion": 1
    },
    {
      "id": "aeef0ccc-3031-40d0-a627-5f21ade148b1",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        -140
      ],
      "parameters": {
        "width": 180,
        "content": "### 4) Passing Score\n* Adjust your passing score here"
      },
      "typeVersion": 1
    },
    {
      "id": "c21dbdb5-ed87-4aac-bbc7-338aaed830ba",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        -100
      ],
      "parameters": {
        "height": 180,
        "content": "### 2) Trigger Node\n* Replace your Google Sheet id's in this node."
      },
      "typeVersion": 1
    },
    {
      "id": "d2b15c40-d38a-4bec-97c8-d4b35e3a69fa",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        40,
        -100
      ],
      "parameters": {
        "width": 260,
        "height": 180,
        "content": "### 3) Extract Node\n* Select the data we want to use to proceed.\n* For this case, i'll select only Name, Email, Score (Because this is only what we need)"
      },
      "typeVersion": 1
    },
    {
      "id": "79957ca7-ac5f-4f5b-b921-ddec3cb9f88b",
      "name": "Extract essential data",
      "type": "n8n-nodes-base.set",
      "position": [
        120,
        60
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "7cdc9108-ab77-4904-a74b-29677b06cc81",
              "name": "respondentName",
              "type": "string",
              "value": "={{ $json['ชื่อ (เป็นภาษาอังกฤษ)'] }}"
            },
            {
              "id": "1800b27a-6cbc-4b82-a17a-87d7d1e7a66e",
              "name": "respondentEmail",
              "type": "string",
              "value": "={{ $json['Email Address'] }}"
            },
            {
              "id": "36cb99ca-7c98-41b5-a2a4-a03ac8d83189",
              "name": "respondentScore",
              "type": "number",
              "value": "={{ $json.Score }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "912838e0-6b35-47a1-8935-dc90b4c59ecb",
      "name": "Score Checker",
      "type": "n8n-nodes-base.if",
      "position": [
        360,
        -20
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "286a95ee-1edc-4310-af22-d161e1f04a27",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $json.respondentScore }}",
              "rightValue": 3
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "9c9e308f-ce90-425d-aafc-08711cbf95df",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        600,
        120
      ],
      "parameters": {
        "width": 260,
        "content": "### 4.1) Score < passing criteria"
      },
      "typeVersion": 1
    },
    {
      "id": "f794c7a3-47af-4166-9504-8265837f61e6",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        520,
        -340
      ],
      "parameters": {
        "width": 260,
        "height": 200,
        "content": "### 4.2) Score > passing criteria\n* Create new Google Slide \n* Decorate it as you desired (This will be certificate's template)\n* Use [ name ] to be a placeholder for user's name\n* Replace it with your Google Slide's id"
      },
      "typeVersion": 1
    },
    {
      "id": "9a2954e3-59fd-4472-931f-9eeb362e627b",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        820,
        -400
      ],
      "parameters": {
        "width": 260,
        "content": "### 5) Replace text\n* This node will replace [ name ] with user's input name.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "baa88ba8-c1c6-40d7-b4c0-1e70397d7e68",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        940,
        -80
      ],
      "parameters": {
        "width": 260,
        "content": "### 6) To PDF\n* Change file name as you desire."
      },
      "typeVersion": 1
    },
    {
      "id": "0d4b0fad-046b-4810-9d21-2c30135df6b0",
      "name": "Copy from your template",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        620,
        -160
      ],
      "parameters": {
        "name": "={{ $json.respondentName }}'s Certificate",
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "REPLACE_WITH_RESOURCE"
        },
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "REPLACE_WITH_RESOURCE"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "REPLACE_WITH_RESOURCE"
        },
        "operation": "copy",
        "sameFolder": false
      },
      "typeVersion": 3
    },
    {
      "id": "30407819-7998-4ba1-b2a0-bde7ba91747c",
      "name": "Replace text",
      "type": "n8n-nodes-base.googleSlides",
      "position": [
        880,
        -300
      ],
      "parameters": {
        "textUi": {
          "textValues": [
            {
              "text": "[ NAME ]",
              "replaceText": "={{ $('Score Checker').item.json.respondentName }}",
              "pageObjectIds": [
                "p"
              ]
            }
          ]
        },
        "options": {},
        "operation": "replaceText",
        "presentationId": "={{ $json.id }}"
      },
      "typeVersion": 2
    },
    {
      "id": "62f1ab2e-0471-480b-9a90-587a9ffb18d6",
      "name": "Convert to PDF",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        960,
        0
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.presentationId }}"
        },
        "options": {
          "fileName": "={{ $('Score Checker').item.json.respondentName }}'s Certificate",
          "googleFileConversion": {
            "conversion": {
              "slidesToFormat": "application/pdf"
            }
          }
        },
        "operation": "download"
      },
      "typeVersion": 3,
      "alwaysOutputData": false
    },
    {
      "id": "08516c84-5257-4875-8c2f-9b6a4428bfad",
      "name": "Send to user's email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1360,
        0
      ],
      "parameters": {
        "sendTo": "={{ $('Score Checker').item.json.respondentEmail }}",
        "message": "=Congratulations on passing the quiz! Attached is your certificate.",
        "options": {
          "attachmentsUi": {
            "attachmentsBinary": [
              {}
            ]
          },
          "appendAttribution": false
        },
        "subject": "Here's your certificate!!"
      },
      "typeVersion": 2.1
    },
    {
      "id": "ae4cd0de-e06d-4200-af17-f6e9953ccba7",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1260,
        -100
      ],
      "parameters": {
        "width": 260,
        "content": "### 7) Send email\n* Send to user's email\n* Customize your message here.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "f015475a-7873-5012-b084-99ae802615d9",
      "name": "Publication · Overview and setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1040,
        -400
      ],
      "parameters": {
        "content": "# DSP Certificate w/ Google Forms\n\n## Purpose and structure\nThis folder contains the **DSP Certificate w/ Google Forms** workflow. Its executable nodes use `gmail`, `googleDrive`, `googleSheetsTrigger`, `googleSlides`, `if`, `noOp`, `set`. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.\n\n## Setup\nImport inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.\n\n## Entry points\nGoogle Sheets Trigger\n\n## Verification\nSanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.\n\n## Attribution\nhttps://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Googleslides/0754_Googleslides_Noop_Automation_Triggered.json\nMIT; preserve source notices.",
        "width": 700,
        "height": 800,
        "color": 1
      }
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "connections": {
    "Replace text": {
      "main": [
        [
          {
            "node": "Convert to PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Score Checker": {
      "main": [
        [
          {
            "node": "Copy from your template",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to PDF": {
      "main": [
        [
          {
            "node": "Send to user's email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets Trigger": {
      "main": [
        [
          {
            "node": "Extract essential data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract essential data": {
      "main": [
        [
          {
            "node": "Score Checker",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Copy from your template": {
      "main": [
        [
          {
            "node": "Replace text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
