<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Vryntel</title>
    <description>The latest articles on Forem by Vryntel (@vryntel).</description>
    <link>https://forem.com/vryntel</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F794196%2Faedf8b31-c19f-40a1-96c5-befd0a9137e0.png</url>
      <title>Forem: Vryntel</title>
      <link>https://forem.com/vryntel</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/vryntel"/>
    <language>en</language>
    <item>
      <title>Check Links with Google Spreadsheet</title>
      <dc:creator>Vryntel</dc:creator>
      <pubDate>Sun, 21 Jul 2024 17:25:59 +0000</pubDate>
      <link>https://forem.com/vryntel/check-links-with-google-spreadsheet-2091</link>
      <guid>https://forem.com/vryntel/check-links-with-google-spreadsheet-2091</guid>
      <description>&lt;p&gt;In this tutorial I'll show you how you can check multiple links with a Google Spreadsheet and a simple Google Apps Script.&lt;/p&gt;

&lt;p&gt;You may find this article useful if you have a lot of links and want to find broken ones, or for example, if you are testing some API endpoints with different parameters, headers, or body and want to check http responses.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsk7r0id4a68x2kigzwqf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsk7r0id4a68x2kigzwqf.png" alt="Spreadsheet"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Spreadsheet + Google Apps Script:&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.google.com/spreadsheets/d/1UyuKCRO8BWcIaluGEYTuUZglBryo0uFBji2a6tbBXCw/copy" rel="noopener noreferrer"&gt;https://docs.google.com/spreadsheets/d/1UyuKCRO8BWcIaluGEYTuUZglBryo0uFBji2a6tbBXCw/copy&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Github Page:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Vryntel/Spreadsheet-Url-Tester" rel="noopener noreferrer"&gt;https://github.com/Vryntel/Spreadsheet-Url-Tester&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Spreadsheet Structure
&lt;/h2&gt;

&lt;p&gt;The spreadsheet is composed by 2 sheet:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data&lt;/li&gt;
&lt;li&gt;Settings&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Data sheet use the following columns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Column A&lt;/strong&gt;: URL&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Column B&lt;/strong&gt;: HTTP request method (Supported HTTP request methods: GET, POST, DELETE, PATCH, PUT)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Column C&lt;/strong&gt;: params in JSON format&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
URL: &lt;code&gt;https://mywebsite.com&lt;/code&gt;&lt;br&gt;
PARAMS: &lt;code&gt;{"param1":"test", "params2":"test2"}&lt;/code&gt;&lt;br&gt;
FETCHED URL: &lt;code&gt;https://mywebsite.com?param1=test&amp;amp;param2=test2&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Column D&lt;/strong&gt;: headers in JSON format&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Column E&lt;/strong&gt;: Body Type that can be JSON or TEXT&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Column F&lt;/strong&gt;: body in JSON/TEXT format&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Column G&lt;/strong&gt;: Response Code returned by the request&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Column H&lt;/strong&gt;: Response Body returned by the request&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the Settings sheet you can edit some adavnced settings of the HTTP requests:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;validateHttpsCertificates&lt;/strong&gt;: TRUE/FALSE --&amp;gt; If FALSE the fetch ignores any invalid certificates for HTTPS requests&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;followRedirects&lt;/strong&gt;: TRUE/FALSE --&amp;gt; If FALSE the fetch doesn't automatically follow HTTP redirects; it returns the original HTTP response&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;p&gt;After making a copy of the spreadsheet, in the top toolbar will appear the option "Url Tester" and then "Test Urls" (if it doesn't appear try to reload the page). &lt;/p&gt;

&lt;p&gt;To run the script you need to click Test Urls option. Only the first time it will ask you to grant permission for the script to be executed.&lt;/p&gt;

&lt;p&gt;If you only need to use the spreadsheet to check for broken links, you can use only the column A to insert the links and in the column B you can leave the GET method for each url row. When you run the script, the response code will appear in the column G and if it's OK it will be printed the code 200, otherwise another code, you can see all possible codes here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/HTTP/Status&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some notes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Google Apps Script has some limitations regarding URL Fetch calls ( at the moment is 20,000 / day). So if you have more than 20,000 URLs to test, consider to split them in more groups and test in multiple days. 
There are also other limitations regardings headers size, response size ecc. 
You can find all the limitations here:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://developers.google.com/apps-script/guides/services/quotas" rel="noopener noreferrer"&gt;https://developers.google.com/apps-script/guides/services/quotas&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can hide (not delete) some columns that you don't need, for example columns C, D, E, F.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>productivity</category>
      <category>javascript</category>
      <category>googlecloud</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to Duplicate any Google Form</title>
      <dc:creator>Vryntel</dc:creator>
      <pubDate>Mon, 29 Jan 2024 11:08:51 +0000</pubDate>
      <link>https://forem.com/vryntel/how-to-duplicate-any-google-form-32la</link>
      <guid>https://forem.com/vryntel/how-to-duplicate-any-google-form-32la</guid>
      <description>&lt;p&gt;Unlike Google Sheets, Google Form doesn't offer a direct way to make a copy of a public Google Form, without being an owner or a collaborator of the form itself.&lt;/p&gt;

&lt;p&gt;As a work-around you can use the FormDuplicator tool, that is a Google Spreadsheet bounded with a Google Apps Script that can clone every public Google Form.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa1m9457w1tu3j0z9lppk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa1m9457w1tu3j0z9lppk.png" alt="Image description" width="800" height="343"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;FormDuplicator spreadsheet:&lt;br&gt;
&lt;a href="https://docs.google.com/spreadsheets/d/1nYBfvTkIWfmBFhnaNFrDDQh5m_9GJ0m0xHPbqVQhfD4/copy"&gt;https://docs.google.com/spreadsheets/d/1nYBfvTkIWfmBFhnaNFrDDQh5m_9GJ0m0xHPbqVQhfD4/copy&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Github page:&lt;br&gt;
&lt;a href="https://github.com/Vryntel/FormDuplicator"&gt;https://github.com/Vryntel/FormDuplicator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After making a copy of the spreadsheet, to be able to run the script you need to grant permission to the script (only the first time) by following these steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the Spreadsheet page, go in the top toolbar and click Extensions &amp;gt; Apps Script&lt;/li&gt;
&lt;li&gt;After the new page will open up, return in the spreadsheet page and in the top toolbar it will show up the FormDuplicator option&lt;/li&gt;
&lt;li&gt;Click on the FormDuplicator option in the toolbar, and then click on "Duplicate Form"&lt;/li&gt;
&lt;li&gt;At this point Google will ask your authorization to run the script, you need to grant it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now to clone a Google Form, just paste the form url in the "Form to duplicate" field and then go to the top toolbar, FormDuplicator, Duplicate Form.&lt;/p&gt;

&lt;p&gt;After the script will finish its execution, a pop-up will show up with a message:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;"Form Duplicated correctly": The form has been duplicated exactly as the original form. Your copy of the Google Form will be printed in the "Generated Form" field;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"Form Partially duplicated": The form has been duplicated but without some propeties. All the not duplicated proprieties will be displayed in the "Not duplicated" worksheet;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For the list of what the tool can't duplicate from a form, check my Github page:&lt;br&gt;
&lt;a href="https://github.com/Vryntel/FormDuplicator"&gt;https://github.com/Vryntel/FormDuplicator&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Error": If some values are missing in the settings worksheet or an unexpected error has occured;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thank you for reading.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>googlecloud</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Google Sheets add a Background Music</title>
      <dc:creator>Vryntel</dc:creator>
      <pubDate>Thu, 20 Jan 2022 11:11:11 +0000</pubDate>
      <link>https://forem.com/vryntel/google-sheets-add-a-background-music-2c10</link>
      <guid>https://forem.com/vryntel/google-sheets-add-a-background-music-2c10</guid>
      <description>&lt;p&gt;&lt;strong&gt;In this tutorial I'll show you how to play a music or an audio directly in your sheet.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In Google Sheet it's not possible to directly add a music and play it. But, with the help of the Google Apps Script Platform, we can embed a sidebar in our sheet, and from there add and listen every audio we want. &lt;br&gt;
Could be a music, a relaxing sound effect or any sound you want!&lt;/p&gt;

&lt;p&gt;And we can also play it automatically, when the sheet is open so we don't need to click anything. You open the sheet and the music start to play. &lt;/p&gt;

&lt;p&gt;Let's start.&lt;/p&gt;

&lt;p&gt;First thing you need to create a new sheet, click on "Extensions" in the menu bar, and click on "Apps Script".&lt;/p&gt;

&lt;p&gt;Now copy this function that will run automatically when you open your sheet:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

function onOpen(e) {
  //create a menu bar element to open the sidebar
  SpreadsheetApp.getUi()
  .createMenu('Music Player')
  .addItem('Show sidebar', 'showSidebar')
  .addToUi();
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This function creates a new menu called "Music Player" in the menu bar, creates an element inside this menu called "Show sidebar" and assign the function "showSidebar" to the click on this element.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

function showSidebar() {
  //create sidebar layout from file Sidebar.html
  var ui = HtmlService.createTemplateFromFile('Sidebar')
    .evaluate()
    .setSandboxMode(HtmlService.SandboxMode.IFRAME)
    .setTitle("Music Player");

  SpreadsheetApp.getUi().showSidebar(ui);
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now we need to define the layout file of the sidebar. &lt;br&gt;
Create a new HTML file, by clicking the "+" symbol near files, and call this file "Sidebar".&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&amp;lt;!-- Use a templated HTML printing scriptlet to import common stylesheet --&amp;gt;
&amp;lt;?!= HtmlService.createHtmlOutputFromFile('Stylesheet').getContent(); ?&amp;gt;

&amp;lt;div class="sidebar branding-below"&amp;gt;
  &amp;lt;p&amp;gt;
    Play some chill music.
  &amp;lt;/p&amp;gt;
  &amp;lt;audio id="player" controls&amp;gt;
    &amp;lt;source src="http://docs.google.com/uc?export=open&amp;amp;id=XXXXXXXXXXXXXXXXXX" type="audio/mp3"&amp;gt;
    Your browser does not support the audio tag.
  &amp;lt;/audio&amp;gt;
&amp;lt;/div&amp;gt;


&amp;lt;div class="sidebar bottom"&amp;gt;
  &amp;lt;span class="gray branding-text"&amp;gt;PlayMusic&amp;lt;/span&amp;gt;
&amp;lt;/div&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Let's also add a new HTML file called "Stylesheet", which includes the CSS Google style for our sidebar:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&amp;lt;!-- This CSS package applies Google styling; it should always be included. --&amp;gt;

&amp;lt;link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons.css"&amp;gt;

&amp;lt;!-- Customize your audio player --&amp;gt;
&amp;lt;style&amp;gt;
  #player {
    width: 95%;
  }
&amp;lt;/style&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The file types supported by the audio tag are MP3, WAV, and OGG (Depending on the browser, some types aren't supported).&lt;br&gt;
So in the source link you can insert any link that end with ".mp3", ".wav" or ".ogg".&lt;/p&gt;

&lt;p&gt;If you want to use a Google Drive audio, you need to make the file public by sharing it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh02rx50yss7m21b8g542.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh02rx50yss7m21b8g542.JPG" alt="Share File"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And click on "change to everyone with the link":&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdw2nx6sn42pjkm2a0ujy.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdw2nx6sn42pjkm2a0ujy.JPG" alt="Make Public"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will get a link like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https://drive.google.com/file/d/XXXXXXXXXXXXXXXXXX/view?usp=sharing&lt;/code&gt;  &lt;/p&gt;

&lt;p&gt;The XXXXXXXXXXXXXXXXXX string is your file ID. But we can't use this link. To obtain a direct link to the mp3, just add that ID to this link:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;http://docs.google.com/uc?export=open&amp;amp;id=XXXXXXXXXXXXXXXXXX&lt;/code&gt;  &lt;/p&gt;

&lt;p&gt;Copy this link in the src attribute.&lt;/p&gt;

&lt;p&gt;Now everything is ready. Save your project and reload the sheet page. After the loading is complete, you should see the "PlayMusic" menu.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv2sqzanwcei77nm289hs.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv2sqzanwcei77nm289hs.JPG" alt="PlayMusic menu bar"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on show sidebar and the audio player will show up in the right.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flybsanmisgwpap4w8jh7.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flybsanmisgwpap4w8jh7.JPG" alt="Sidebar"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to play the music automatically, without clicking in the menu bar, you need to add the "autoplay" attribute to the audio tag, in the HTML file (you can also add a loop in your audio, with the "loop" attribute after the autoplay attribute).&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;audio id="player" controls autoplay&amp;gt;&lt;/code&gt;    &lt;/p&gt;

&lt;p&gt;Another thing you need to change if you want to autoplay the audio, is the onOpen trigger. This because the "onOpen" function (with this specific name) is a default function that is associated with a simple trigger, but all simple trigger have some limitations, so in this case we need to add our "onOpen" trigger. Before this we can modify the name of the function "onOpen" to "onOpenAutoplay", and add inside it a call to our showSidebar function.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

function onOpenAutoplay(e) {
  //create a menu bar element to open the sidebar
  SpreadsheetApp.getUi()
  .createMenu('Music Player')
  .addItem('Show sidebar', 'showSidebar')
  .addToUi();
  //on sheet open, show the sidebar that autoplay the audio inside it
  showSidebar();
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Last thing we need to add our custom trigger. So go in the trigger section on the left (the timer icon), add a new trigger with these settings:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F12w4fl37skxb0wwwyg3s.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F12w4fl37skxb0wwwyg3s.JPG" alt="Trigger"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Save, reload the sheet and enjoy your music :D&lt;/p&gt;

&lt;p&gt;Other info:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The first time you run the script, it will ask you to give permissions&lt;/li&gt;
&lt;li&gt;If the sheet is in view mode only, only you can run the script  and play the music. If you make the sheet editable for everyone with the link, only non-anonymous user (logged account) will be able to run the script.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>googlecloud</category>
      <category>html</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Google Form countries list dropdown</title>
      <dc:creator>Vryntel</dc:creator>
      <pubDate>Tue, 18 Jan 2022 16:35:54 +0000</pubDate>
      <link>https://forem.com/vryntel/google-form-countries-list-dropdown-27d3</link>
      <guid>https://forem.com/vryntel/google-form-countries-list-dropdown-27d3</guid>
      <description>&lt;p&gt;&lt;strong&gt;In this article I’ll show you how you can add a simple dropdown menu with all countries.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Google Form hasn’t a default element to show a list of countries, cities, languages or every other useful list of things. To resolve this problem we can simply copy a list of items (for example from another document) in our form editor answers and create it by ourself.&lt;/p&gt;

&lt;p&gt;First thing you need a list of countries. You can grab it from Internet but, to make your work easier, I already created one in this Google Sheet:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.google.com/spreadsheets/u/1/d/1vDD6D0ogBrA4vOTKhttSUB7wcpNApJ7SBM5AX9oyRTw/edit?usp=sharing"&gt;https://docs.google.com/spreadsheets/u/1/d/1vDD6D0ogBrA4vOTKhttSUB7wcpNApJ7SBM5AX9oyRTw/edit?usp=sharing&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you need to copy all the list. You can do this by clicking in the small dropdown arrow near the A column letter:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frpnhu6tanlcbgv4uq1l2.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frpnhu6tanlcbgv4uq1l2.JPG" alt="List of countries" width="751" height="329"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click copy.&lt;/p&gt;

&lt;p&gt;Now return in the form editor page, click on the first answer of the dropdown and paste all the list.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ku7cub1rvx706gy0zq3.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ku7cub1rvx706gy0zq3.JPG" alt="Dropdown list" width="800" height="369"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We created a dropdown menu with all countries.&lt;/p&gt;

&lt;p&gt;You can repeat this process with every list you want and you can copy the list in other form elements like checkboxes or multiple choices question.&lt;/p&gt;

</description>
      <category>googlecloud</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Add Responses Counter To Your Google Form</title>
      <dc:creator>Vryntel</dc:creator>
      <pubDate>Sun, 16 Jan 2022 18:17:42 +0000</pubDate>
      <link>https://forem.com/vryntel/add-responses-counter-to-your-google-form-13np</link>
      <guid>https://forem.com/vryntel/add-responses-counter-to-your-google-form-13np</guid>
      <description>&lt;p&gt;&lt;strong&gt;In this article I'll show you how to add a responses counter text, directly in the form, by using a simple script.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We will see two different type of counter, an incremental counter that will show how many people submitted our form, and a decremental counter, useful for example when you need to organize a limited event.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Incremental Counter:&lt;/em&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzej3upqir6821zz14cgs.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzej3upqir6821zz14cgs.JPG" alt="Incremental Counter"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Decremental Counter:&lt;/em&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw75b2r00xv7iztm2m2qy.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw75b2r00xv7iztm2m2qy.JPG" alt="Decremental Counter"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To make this, we will use the Google Apps Script Platform. &lt;/p&gt;

&lt;p&gt;Create a new form or open one you already have. Add a new title and description element like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqcag5rjpwwpvhdyh715k.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqcag5rjpwwpvhdyh715k.JPG" alt="Add Title and Description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After this, click on the three dots in the right of the page and click on Script Editor.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8l3dl87x5kbyazwy2e83.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8l3dl87x5kbyazwy2e83.JPG" alt="Script Editor"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now in the Editor page just copy this code for the incremental counter:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

function increaseCounter() {
  // Get the form to which this script is bound.
  var form = FormApp.getActiveForm();

  //Get responses number
  var responses = form.getResponses().length;

  //The position of the question to change, starting from 0
  var questionIndex = 0;

  //Get the question and update the counter
  var question = form.getItems()[questionIndex];
  question.setTitle("This form has been submitted " + responses + " times");

  //To change the title or the description of the form
  //form.setDescription("Counter: " + responses);
  //form.setTitle("Counter: " + responses);
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And this for the decremental counter: &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

function decreaseCounter() {
  // Get the form to which this script is bound.
  var form = FormApp.getActiveForm();

  //Get responses number
  var responses = form.getResponses().length;

  var startCounter = 200;
  var currentCounter = startCounter - responses;

  //The position of the question to change, starting from 0
  var questionIndex = 0;

  //Get the question and update the counter
  var question = form.getItems()[questionIndex];
  question.setTitle("Only " + currentCounter + " tickets remaining");

  //To change the title or the description of the form
  //form.setDescription("Counter: " + currentCounter);
  //form.setTitle("Counter: " + currentCounter);
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You can also update the Form Title and Description, or any other form questions you want, all you need is the position index in the form (just count the questions from the top and starting from 0).&lt;/p&gt;

&lt;p&gt;Save the project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmcaq9yg4srhfaqmru1bs.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmcaq9yg4srhfaqmru1bs.JPG" alt="Save project"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we need only to update the counter every time a user submit a new response. In other words we need to add a new event trigger that will run on every form submit action. To add a new trigger click on triggers on the left bar.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgooqyogd0bv5y5f7ecm4.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgooqyogd0bv5y5f7ecm4.JPG" alt="Add Trigger"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on Add trigger button, on the bottom right, select the function to run and set the event type to "On form submit". &lt;br&gt;
Click on save.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7o20p6uuahv1fr1t38ug.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7o20p6uuahv1fr1t38ug.JPG" alt="Trigger details"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now the counter is ready :)&lt;/p&gt;

</description>
      <category>googlecloud</category>
      <category>tutorial</category>
      <category>javascript</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
