0% found this document useful (0 votes)
56 views

Script QR Code

The document contains code for two functions - MencariID and MencariNama. Both functions get the active spreadsheet, sheet, and range. They get all files from a specific folder ID, push the file IDs or names into an array, and set the array formulas into a spreadsheet range. The last section provides formulas to generate QR code links and view links using the IDs from column A.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views

Script QR Code

The document contains code for two functions - MencariID and MencariNama. Both functions get the active spreadsheet, sheet, and range. They get all files from a specific folder ID, push the file IDs or names into an array, and set the array formulas into a spreadsheet range. The last section provides formulas to generate QR code links and view links using the IDs from column A.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

function MencariID() {

var ss=SpreadsheetApp.getActiveSpreadsheet();
var s=ss.getActiveSheet();
var c=s.getRange("a1");
var fldr=DriveApp.getFolderById("=== ID Folder ===");
var files=fldr.getFiles();
var names=[],f,str;
while (files.hasNext()) {
f=files.next();
str = f.getId();
names.push([str]);
}
s.getRange(c.getRow(),c.getColumn(),names.length).setFormulas(names); }

function MencariNama() {
var ss=SpreadsheetApp.getActiveSpreadsheet();
var s=ss.getActiveSheet();
var c=s.getRange("b1");
var fldr=DriveApp.getFolderById("=== ID Folder ===");
var files=fldr.getFiles();
var names=[],f,str;
while (files.hasNext()) {
f=files.next();
str = f.getName();
names.push([str]);
}
s.getRange(c.getRow(),c.getColumn(),names.length).setFormulas(names); }

Link QR
-------
Buat Kolom ID QR dan Link QR
Formula Link QR
=arrayformula(if(row(A:A)=1;"LINK
QR";ARRAYFORMULA(IF((A:A)="";"";"https://drive.google.com/uc?export=vi..."&G:G))))
=arrayformula(if(row(A:A)=1;"LINK
QR";ARRAYFORMULA(IF((A:A)="";"";"https://drive.google.com/uc?
export=view&id="&A:A))))

You might also like