Forum Discussion
Connecting to Google Drive FOLDER
Hi ryan_b_fiting ,
I used Google Scripts and Triggers to do it.
1-> Share a folder;
2 -> Create a Google Spreadsheet to store all shared urls;
3 -> Create a script to get all shared url on the sheet;
4 -> Create a trigger to update the sheets (I have scheduled once a day, but you have many options). You can find the Trigger Editor on "Edit -> Current Project's Trigger". Just select the script function you saved and the recurrency;
5 -> Connect the Spreadsheet (item 2) to Power BI;
This is the script I used:
function onLoad() {
var ss=SpreadsheetApp.getActiveSpreadsheet();
var s=ss.getActiveSheet();
var c=s.getActiveCell();
var fldr=DriveApp.getFolderById("USE_THE_SHARED_FOLDER_URL");
var files=fldr.getFiles();
var data=[],f,str;
var ss = SpreadsheetApp.getActiveSheet();
ss.clear();
ss.appendRow(["Name", "Date", "Id"]);
while (files.hasNext()) {
f=files.next();
data = [
f.getName(),
f.getDateCreated(),
f.getId()
];
ss.appendRow(data);
}
}
I hope this helps you,
Ricardo