Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!

How to use Cloud Storage Connector for Dropbox with Qlik Application Automation

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Alvaro_Palacios
Support
Support

How to use Cloud Storage Connector for Dropbox with Qlik Application Automation

Last Update:

Sep 15, 2021 8:19:03 AM

Updated By:

Alvaro_Palacios

Created date:

Sep 9, 2021 7:13:02 AM

Attachments

This article gives an overview of the available blocks in the cloud storage connector in Qlik Application Automation to work with files in Dropbox. It will provide some basic examples of listing files, opening a file, reading from a file, creating a new file, and writing lines to a file.

The cloud storage connector supports other blocks to copy files, move files and check if a file already exists that could help to cover other uses cases. It is recommended to use the blocks in this connector, i.e. Cloud Storage, when working or manipulating files. For other type of operations, such as creating a sharing link for a file, making generic calls, or getting other metadata from your account, please use the blocks available in the Dropbox connector in Qlik Application Automation.

Authentication for this connector is based on the oAuth2 Protocol. For more details check this article.

Let's now go over a few basic operations of how to use the cloud storage blocks work for Dropbox:

  1. How to list files from a Dropbox account 
    1. Create an automation.
    2. From the left menu, select the Cloud Storage connector
Alvaro_Palacios_0-1631184889240.png

 

c. Search for the List Files block from the available list of blocks.

Alvaro_Palacios_1-1631184889246.png

 

d. Drag and drop the block into the automation and connect it after the Start block.

Alvaro_Palacios_2-1631184889254.png

 

e. The ‘Path’ parameter of this block allows to list the contents of a specific directory from a Dropbox account. In this example, ‘./’ indicates the root directory.

f. Drag and drop the ‘Output’ block into the automation and connect it to the ‘List Files on Dropbox’ block.

Alvaro_Palacios_3-1631184889266.png

 

g. Run the automation (if not saved previously, a 'Save automation' popup will appear). This will output a paginated list of files available in the root directory of a Dropbox account.

 

2. How to open an existing file and read from it

a. The first two steps are similar as described before
b. Now use the ‘Open File’ block from the list
c. Drag and drop the block into the automation, link it to the Start block and enter the ‘Path’ to the file including the extension, e.g. ./Blendr/Monitoring_Blends.csv

Alvaro_Palacios_4-1631184889273.png

 

d. Drag and drop the ‘Read Data From File’ and link it to the previous block. Use the output from the previous block as input.

Alvaro_Palacios_5-1631184889286.png

 

e. Drag and drop the ‘Output’ block into the automation before running the automation. This will output a paginated table with the rows stored in the file.

Alvaro_Palacios_6-1631184889301.png

 

3. How to create a new file (if it doesn’t exist and delete if it does), write to file, save and close file

a. The first two steps are similar as in the two previous use cases
b. Now select the ‘Check If File Exists’, drag and drop it into the automation and link it to the Start block.

Alvaro_Palacios_7-1631184889308.png

 

c. The previous block will return ‘True’ if the file exists, and ‘False’ if it doesn’t. Now search for the ‘Condition’ block to drag and drop it into the automation. Link it to the previous block and add the following condition:

Alvaro_Palacios_8-1631184889319.png

 

d. First let’s work on the ‘YES’ part of the condition. Search the ‘Delete File’ block and drag and drop it into the automation. This will delete the file in the specified directory if it already exists.

e. Next, search the ‘Create File’ block, add it to the automation, and link it to the previous block.

f. Search the ‘Write Line to File’ block and link it to the ‘Create File on Dropbox’ block. Fill in the required input parameters. If you select CSV under ‘Mode’, the column names (headers) of the file can be added at the same time as the data rows.

Alvaro_Palacios_9-1631184889364.png

 

g. This example shows how to add ‘Column names’ manually but, of course, these could be retrieved from other files stored in Dropbox, or objects using the Get Keys formula. Same applies to the ‘Data’ input box, values have been added manually in this example but could be read from other files on Dropbox or other cloud data sources.

h. Finally, search the ‘Save and Close’ block, and link it to the ‘Write Line to File’ block. Optionally, add the ‘Output’ block into the automation which will show the path where the file has been saved and closed on the Dropbox account.

Alvaro_Palacios_10-1631184889397.png

 

i. Last part of the automation is the ‘NO’ condition (file doesn’t exist) which basically means adding the same blocks as before apart from the ‘Delete File’ block.

Alvaro_Palacios_11-1631184889417.png

Attached downloadable example file: create_and_write_files_dropbox.json

The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.

Tags (1)
Contributors
Version history
Last update:
‎2021-09-15 08:19 AM
Updated by: