<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Load data from several google drive folders in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Load-data-from-several-google-drive-folders/m-p/1881471#M72623</link>
    <description>&lt;P&gt;Dear all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;hope you are doing fine!&lt;/P&gt;
&lt;P&gt;I have an issue with loading data from google drive. I want to load several files from different folders on google drive. I found several options to load data from dropbox. The skrip is like this:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LIB CONNECT TO 'Dropbox_NAME - Mail';&lt;/P&gt;
&lt;P&gt;Ordner:&lt;BR /&gt;LOAD tag as [List.tag], &lt;BR /&gt;name as [List.name];&lt;BR /&gt;SELECT tag,&lt;BR /&gt;name&lt;BR /&gt;FROM List&lt;BR /&gt;WITH PROPERTIES (&lt;BR /&gt;dropboxFolder='/Name',&lt;BR /&gt;recursive='false',&lt;BR /&gt;includeDeleted='false'&lt;BR /&gt;)&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;x:&lt;BR /&gt;Load [List.name]&lt;BR /&gt;Resident Ordner &lt;BR /&gt;Order By [List.name] asc;&lt;/P&gt;
&lt;P&gt;DROP TABLE Folder;&lt;/P&gt;
&lt;P&gt;LIB CONNECT TO (dropbox)&lt;A href="mailto:m.wiedemann@emotion-ebikes.de';" target="_blank" rel="noopener"&gt;;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;for iFolder = 0 to NoOfRows('x') - 1&lt;BR /&gt;let vFolder = peek('List.name', iFolder, 'x');&lt;BR /&gt;&lt;BR /&gt;Sales: &lt;BR /&gt;LOAD *&lt;BR /&gt;FROM [lib://dropbox -Mail/Folder/$(vFolder)/sales_x.csv] (txt, codepage is 28591, embedded labels, delimiter is ';', msq);&lt;/P&gt;
&lt;P&gt;This works for Dropbox, but I dont know how to do this with google drive. What do i put instead of "&amp;nbsp;dropboxFolder='/Name'," ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If i just change the source, it tells me "&lt;SPAN&gt;Cannot open file".&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;I appreciate your help!!!&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;Anna&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jan 2022 12:55:03 GMT</pubDate>
    <dc:creator>Anna12</dc:creator>
    <dc:date>2022-01-17T12:55:03Z</dc:date>
    <item>
      <title>Load data from several google drive folders</title>
      <link>https://community.qlik.com/t5/App-Development/Load-data-from-several-google-drive-folders/m-p/1881471#M72623</link>
      <description>&lt;P&gt;Dear all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;hope you are doing fine!&lt;/P&gt;
&lt;P&gt;I have an issue with loading data from google drive. I want to load several files from different folders on google drive. I found several options to load data from dropbox. The skrip is like this:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LIB CONNECT TO 'Dropbox_NAME - Mail';&lt;/P&gt;
&lt;P&gt;Ordner:&lt;BR /&gt;LOAD tag as [List.tag], &lt;BR /&gt;name as [List.name];&lt;BR /&gt;SELECT tag,&lt;BR /&gt;name&lt;BR /&gt;FROM List&lt;BR /&gt;WITH PROPERTIES (&lt;BR /&gt;dropboxFolder='/Name',&lt;BR /&gt;recursive='false',&lt;BR /&gt;includeDeleted='false'&lt;BR /&gt;)&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;x:&lt;BR /&gt;Load [List.name]&lt;BR /&gt;Resident Ordner &lt;BR /&gt;Order By [List.name] asc;&lt;/P&gt;
&lt;P&gt;DROP TABLE Folder;&lt;/P&gt;
&lt;P&gt;LIB CONNECT TO (dropbox)&lt;A href="mailto:m.wiedemann@emotion-ebikes.de';" target="_blank" rel="noopener"&gt;;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;for iFolder = 0 to NoOfRows('x') - 1&lt;BR /&gt;let vFolder = peek('List.name', iFolder, 'x');&lt;BR /&gt;&lt;BR /&gt;Sales: &lt;BR /&gt;LOAD *&lt;BR /&gt;FROM [lib://dropbox -Mail/Folder/$(vFolder)/sales_x.csv] (txt, codepage is 28591, embedded labels, delimiter is ';', msq);&lt;/P&gt;
&lt;P&gt;This works for Dropbox, but I dont know how to do this with google drive. What do i put instead of "&amp;nbsp;dropboxFolder='/Name'," ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If i just change the source, it tells me "&lt;SPAN&gt;Cannot open file".&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;I appreciate your help!!!&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;Anna&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jan 2022 12:55:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-data-from-several-google-drive-folders/m-p/1881471#M72623</guid>
      <dc:creator>Anna12</dc:creator>
      <dc:date>2022-01-17T12:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Load data from several google drive folders</title>
      <link>https://community.qlik.com/t5/App-Development/Load-data-from-several-google-drive-folders/m-p/1882726#M72669</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/127667"&gt;@Anna12&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You can achieve the above using a combination of Google Drive and Spreadsheets connector and the Google Drive connector.&lt;/P&gt;&lt;P&gt;Basically you can use Google Drive and Spreadsheets connector to get get the folders and folder id:s from Google Drive:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SELECT title,
	id
FROM ListFiles
WITH PROPERTIES (
driveId='',
query='mimeType = ''application/vnd.google-apps.folder'''
);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After identifying the folder id:s, you can loop through the selected folder(s) and filter on specific file types. As an example, let's filter out csv files only:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SELECT title,
        id,
        mimeType
    FROM ListFiles
    WITH PROPERTIES (
    driveId='',
    query='"$(folder)" in parents and mimeType = ''text/csv'''
    );&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now the Google Drive connector can be used to read in the files (csv:s in this example) located in each folder specified&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;for Each file_name in FieldValueList('file.title');
      Qualify *; // making sure field names are unique to aviod synthetic keys
      LOAD
         *
      FROM [lib://Google_Drive/$(folder)/$(file_name)]
      (txt, codepage is 28591, embedded labels, delimiter is ',', msq);
    next&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is a small example that will make it a bit clearer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to attach the Google connectors to your Google account and then run the script once to get the table id:s in the table. Then manually copy/paste the folders to the variable defined in the script (vFolderIds).&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Bjorn&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 10:58:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-data-from-several-google-drive-folders/m-p/1882726#M72669</guid>
      <dc:creator>Bjorn_Wedbratt</dc:creator>
      <dc:date>2022-01-19T10:58:44Z</dc:date>
    </item>
  </channel>
</rss>

