Apps Script UrlFetchApp Get URL Data and output to Web App Create web App doGet Method Workspace

Fetch in the Class UrlFetchApp can be used to request a response from URLs. Lesson will explore how to apply Google Apps Script to create a request to a web URL, retrieving data back into the web application. Connect to Google and get the web page content as HTML and then output it into a web app all using Google Apps Script Code. https://basescripts.com/google-apps-script-coding-examples-free-pdf-downloadable-guide

Populate Spreadsheet data from Web API

Connect to a web API and return the JSON data to Google Apps Script.  Use the JSON data to return object values that can then be used to populate into a spreadsheet.

1 thought on “Apps Script UrlFetchApp Get URL Data and output to Web App Create web App doGet Method Workspace”

  1. Google scripts error

    Detected unusual line terminators

    The file ‘2’ contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).

    It is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.

    Code
    function doGet(){
const html = getData();
//return ContentService.createTextOutput(html);
return HtmlService.createHtmlOutput(html);
}
    function getData(){
const url = ‘https://www.google.com’;
const response = UrlFetchApp.fetch(url);
return response.getContentText();
}

    Any pointers

Leave a Comment