Forum Discussion

NarayananKumbak's avatar
NarayananKumbak
Qrew Cadet
7 years ago

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

Similar to importing csv data from  a Dropbox folder, can Quick Base upload the output of a report to a folder on Dropbox ?

10 Replies

  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    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
    • NarayananKumbak's avatar
      NarayananKumbak
      Qrew Cadet
      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.
    • PhillipDennis's avatar
      PhillipDennis
      Qrew Cadet
      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.
  • 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
    • _anomDiebolt_'s avatar
      _anomDiebolt_
      Qrew Elite
      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.
    • NarayananKumbak's avatar
      NarayananKumbak
      Qrew Cadet
      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?