Exporting Quick Base report output to a CSV file on Dropbox folder

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
Similar to importing csv data from  a Dropbox folder, can Quick Base upload the output of a report to a folder on Dropbox ?
Photo of NK23

NK23

  • 274 Points 250 badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
Not natively.  You will need a custom integration built.
Like Matthew said, it can only be done outside of Quick Base. But the good news is, it's easy for a programmer to do in just a few hours at the most! Feel free to call or e-mail, and we can talk more specifically about what you need.

PHILLIP DENNIS, CMA
Principal | Watkyn LLC
(954) 900-6690 | www.watkyn.com
hello@watkyn.com

Watkyn LLC
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,322 Points 20k badge 2x thumb
>it can only be done outside of Quick Base

Not true. There is a SDK that can be used from a server or a browser:

Dropbox SDK
https://github.com/dropbox/dropbox-sdk-js
Photo of NK23

NK23

  • 274 Points 250 badge 2x thumb
Thanks for your response. Can I have a .js code page in Quick Base App that can output the result of a Quick Base query to a .csv file on Dropbox? I can do it manually today and I am trying to find out if this can be automated through Quick Base scripts.
Yes it can. The question will be whether it's best to do it in the browser using a code page or on a server. A lot depends on your use case. Feel free to call if you want more information.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,472 Points 20k badge 2x thumb
It is very simple to do from the browser without any other external services or costs.

You will need to obtain an ACCESS_TOKEN from dropbox by registering a new app and answering a few simple questions.

https://www.dropbox.com/developers/apps/create

You must keep this ACCESS_TOKEN secret as it is the key to the account's dropbox kingdom. Oftentimes bearer tokens like this are not used client side as they could leak or be stolen but there are ways to configure things so that if you have trusted QuickBase users you can extend that trust to using Dropbox via a code page in QuickBase. 

That said here is a simple HTML page that will upload a selected file to dropbox



Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=611

You will note that this simple form has a file input whereas you want to upload a report from QuickBase. This is of no consequence as using JavaScript you can easily create a File out of anything using an object called a Blob. In practical terms this means you can use just about any information to build a Blob suitable for  representing your file and passing it to the Dropbox API to upload as a file. This "File from Nothing" has been used several times in other answers in this forum. It is a point I don't think most users understand but you can create a file in code from anything and you don't need to have a file attachment or code page as the source of your file. I your case the file (ie Blob) would simply be built from the response of an API call that was formatted as CSV.

I just used the page to upload a text and pdf file without problems and as soon as I did so I received a notification to my desktop. There are a few open issues such as where the file lands in your Dropbox which I have not tried yet but I would not imagine it is difficult to control.

If you need further help with this problem fee free to contact me through the information in my profile:

https://getsatisfaction.com/people/dandiebolt
(Edited)
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,472 Points 20k badge 2x thumb
I was going to make a live public demo out of this as I have already put the bulk of the code into QuickBase and it works flawlessly. However, I can't expose my real ACCESS_TOKEN nor should I ask you to put your ACCESS_TOKEN into my form. Used in this fashion Dropbox ACCESS_TOKENs are bearer tokens and you need to keep them private.

Although I always test my solutions there are just some things that are difficult or impossible to demonstrate with public demos.
(Edited)
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,472 Points 20k badge 2x thumb
Also Helpful:

How to Get Your Dropbox API Access Token
http://99rabbits.com/get-dropbox-access-token/
Photo of NK23

NK23

  • 274 Points 250 badge 2x thumb
Thank you for all the details. I will have to find some time to digest the suggested solution to see if it will meet my use case. In the meantime, can you confirm if this process of API call to create CSV file and uploading to Dropbox can be scheduled to happen at a certain intervals, say every hour without any manual trigger?
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,472 Points 20k badge 2x thumb
You need some external trigger mechanism (your own server or some service endpoint) or something installed in your open browser. There are a wide array of ways to do this on the cheap using something installed in your browser or on desktop.

Here is a Chrome Crontab extension:

Crontab Extension
https://chrome.google.com/webstore/detail/crontabs/abhmbcedbojnghofcfmnageegmkmpkac?hl=en

Service Workers is eventually going to support periodicSync I think.