Use Google Docs to create shortened URLs


For a long link, shortening the link URL seems to be a very necessary job. Shortened URLs will make our presentation less distracting. Using Google Docs to create URL shortened links is one of many ways that can help us solve this problem.


For a long link, shortening the link URL seems to be a very necessary job. Shortened URLs will make our presentation less distracting. Many of us know about the URL shortening page is Goo.gl , however this page only helps us to shorten the individual URLs, if we have multiple URLs, then using this page will not be convenient anymore. Using Google Docs to create short URLs is a great way to help us solve this problem.

USE GOOGLE DOCS TO CREATE A SHORT URL

We will use Google Apps Script , add a snippet of code to help create shortened URLs with Google Sheet

Step 1 : You open a Google Sheet file you want to use to perform creating shortened URLs.

use google docs to create url rut gon 2

Because when done, the results will be returned to the left, so you should leave the URL column to the left.

Step 2: You click on the item Tools on the tool and select Script editor …

use google docs to create url rut gon 3

Step 3: One page Scipt Editor appears in a new window. You name the file Script By clicking here Untitled project , proceed to name then press Ok, got it to complete.

use google docs to create url rut gon 4

Step 4: A basic Script file will start as shown below

use google docs to create url rut gon 5

Step 5: You copy the entire code below and paste it into the file Script Editor

// When the spreadsheet is opened it adds a menu called “Shorten URL” and a sub menu item called “Shorten”

// This relates to the function below called “short”

function onOpen () {

SpreadsheetApp.getUi ()

.createMenu (“Shorten URL”)

.addItem (“Shorten”, “short”)

.addToUi ()

}

// Takes highlighted range and goes down row by row, adding a short URL to the column to the left

function short () {

var range = SpreadsheetApp.getActiveRange (), data = range.getValues ​​();

var output = [];

for (var i = 0, iLen = data.length; i

var url = UrlShortener.Url.insert ({longUrl: data[i][0]});

output.push ([url.id]);

}

// If you want to put the short URL in a different column, adjust the “-1” in line 20

// Negative number moves to a column to the left; positive number moves to a column to the right.

range.offset (0, -1) .setValues ​​(output);

}

File Script Your screen will look like the image below

use google docs to create url rut gon 6

Step 6: You save the file by clicking on the disk icon

use google docs to create url gon 7

Step 7: Now, you need to enable the Google URL service. This only needs to be completed once. You click on Recources on the tool in the file Script Editor then select Advanced Google Services

use google docs to create url gout 8

Step 8: Dialog box Advanced Google Services will be opened. Scroll down until you see URL Shortener API . Turn it on by clicking on off and then on Ok, got it at the bottom

use google docs to create url gout 9

use google docs to create url rut gon 10

Step 9: Back to the window Script Editor , you continue to click Resources then select Cloud Platform project

use google docs to create url rut gon 11

Step 10: Click on the green link to continue

use google docs to create url gon 12

Step 11: You click Yes then click Accept to continue

use google docs to create url rut gon 13

Step 12: Next you click on APIs & services

use google docs to create url rut gon 14

Step 13: A new page appears, in the section Other popular APIs, you choose URL Shortener API.

use google docs to create url rut gon 15

Step 14: You click on Enable to enable APIs. It will turn from Enable to Disable , that’s okay.

use google docs to create url ron gon 16

Note: The steps above only completed 1 time, can be applied to the next time if you want to use.

Step 15: You go back to your Google Sheet page. You blacked out the boxes with links you want to shorten, select Shorten URL on the toolbar and select Shorten

use google docs to create url rut gon 17

The result appears as below, so it is done

use google docs to create url rut gon 18

Above is a guide to using Google Docs to create shortened URLs with Script Editor in Google Sheet. Hopefully, through this article, you can easily create short urls with Google Docs. If in the process of implementation you have difficulties, do not be afraid to comment below, Taimienphi.vn technical team will support you.

https://thuthuat.taimienphi.vn/su-dung-google-docs-de-tao-url-rut-gon-25865n.aspx
In addition to Google Docs, you can use many other websites to support shortening links, you refer to the top Website shortened link here

.

Add a Comment

Your email address will not be published. Required fields are marked *