Q:

How to open link fetched from google spreadsheet to a html form button

I am able to fetch url from a google spreadsheet but don't know how to open it through html form button.
here is my code.js
function openInputDialog() {
  var html = 
             HtmlService.createHtmlOutputFromFile('Index')
             .setSandboxMode(HtmlService.SandboxMode.IFRAME);
     SpreadsheetApp.getUi()
   .showModalDialog(html, 'Add Item');
 }

function getURL() {
  var ss =  SpreadsheetApp.getActiveSheet();
  var range = ss.getRange("F2:F3");

  Logger.log(range.getValue());

  Logger.log(range.getFormulaR1C1());

   var url = /"(.*?)"/.exec(range.getFormulaR1C1())[1];

 }

here is my html button :- 
<button onclick=" window.open('url','_blank')"> Open Website</button>

Thanks you in advance.

A:

To fetch link from the hyperlink formula use the below code.
function fetchUrls(){
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var sheet = ss.getSheetByName("Sheet1"); //Enter your sheet Name
    var link  =  sheet.getRange("F2").getFormulaR1C1()
    var url = /"(.*?)"/.exec(link)[1];
    Logger.log(url)
    return url;
}

