script to export QuickBase table data to local csv file

  • 0
  • 1
  • Question
  • Updated 9 months ago
  • Answered
I have a need to export QuickBase table data to a local csv file (Lan directory).
In looking at the QuickBase API reference, I see a call ImportFromCSV but no export or download call. It would seem to me if I had a DoQuery to pull the needed data bundled with a download call of some kind that would do the trick.
My background is in IT although my JavaScript is a little rusty.
Any assistance I can get on this would be greatly appreciated.
Photo of Lawrence Clink

Lawrence Clink

  • 190 Points 100 badge 2x thumb

Posted 9 months ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,322 Points 20k badge 2x thumb
The easiest way is to just add the opts parameter to the end of a query URL and package that as a formula URL or Rich Text Field button
?a=q&qid=87&opts=csv
If you want to automatically download the file under script control and even give it the name you want there is some script that can do this as well. In fact, you don't even need to have a file or a URL to form the content of the download. Using script it is possible to build a file blob out of whatever data you want, and download it with the name of your choice. So if you work with some type of commercial or proprietary file format and the underlying data is in QuickBase it is possible to build the file dynamically and download it with the name and extension of your choice.
Photo of Lawrence Clink

Lawrence Clink

  • 190 Points 100 badge 2x thumb
Thank you for the quick response. What I have in mind is a button on a dashboard that calls a script to download the data of my choosing to a location/filename determined in the script. I think more details would help me get started.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,272 Points 20k badge 2x thumb
You will not be able to control where the file lands (without some extraordinary configuration) - it is going into the download folder. Doing otherwise could be a security issue unless precautions were taken.

That said there is probably a way to set up a custom protocol handler or in a Windows environment use an Office URI Scheme that will take a URL pointing to a csv/excel file and automatically load it into a locally installed program.such as MS Office:

Office URI Schemes
https://msdn.microsoft.com/en-us/library/office/dn906146.aspx

This is a largely unexplored area in terms of using these methods with QuickBase. It is totally dependent on the precise combination of (1) Platform, (2) Browser and (3) Configuration you are using.

I wasn't prepared to discuss this topic yet but there is a vast area of what I call QuickBase Deep Linking which you can become familiar with using this overview article:

What is Deep Linking
https://branch.io/what-is-deep-linking/

A Brief History of Deep Linking

https://techcrunch.com/2015/06/12/a-brief-history-of-deep-linking/
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,272 Points 20k badge 2x thumb
You will not be able to control where the file lands (without some extraordinary configuration) - it is going into the download folder. Doing otherwise could be a security issue unless precautions were taken.

That said there is probably a way to set up a custom protocol handler or in a Windows environment use an Office URI Scheme that will take a URL pointing to a csv/excel file and automatically load it into a locally installed program.such as MS Office:

Office URI Schemes
https://msdn.microsoft.com/en-us/library/office/dn906146.aspx

This is a largely unexplored area in terms of using these methods with QuickBase. It is totally dependent on the precise combination of (1) Platform, (2) Browser and (3) Configuration you are using.

I wasn't prepared to discuss this topic yet but there is a vast area of what I call QuickBase Deep Linking which you can become familiar with using this overview article:

What is Deep Linking
https://branch.io/what-is-deep-linking/

A Brief History of Deep Linking

https://techcrunch.com/2015/06/12/a-brief-history-of-deep-linking/
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,322 Points 20k badge 2x thumb
You will not be able to control where the file lands (without some extraordinary configuration) - it is going into the download folder. Doing otherwise could be a security issue unless precautions were taken.

That said there is probably a way to set up a custom protocol handler or in a Windows environment use an Office URI Scheme that will take a URL pointing to a csv/excel file and automatically load it into a locally installed program.such as MS Office:

Office URI Schemes
https://msdn.microsoft.com/en-us/library/office/dn906146.aspx

This is a largely unexplored area in terms of using these methods with QuickBase. It is totally dependent on the precise combination of (1) Platform, (2) Browser and (3) Configuration you are using.

I wasn't prepared to discuss this topic yet but there is a vast area of what I call QuickBase Deep Linking You can become familiar with the concept of Deep Linking using these simple articles:

What is Deep Linking
https://branch.io/what-is-deep-linking/

A Brief History of Deep Linking

https://techcrunch.com/2015/06/12/a-brief-history-of-deep-linking/
Photo of Lawrence Clink

Lawrence Clink

  • 190 Points 100 badge 2x thumb
Ok, thanks for the info. I will continue to research.