Disclaimer: Since this approach refers to elements in Looker’s DOM, it can’t be guaranteed to work for any particular future version. That said, it would probably be easy to update!
If you’d like to hard-code certain download options and skip past the download modal, you can leverage a bookmarklet and some knowledge of Looker’s URL structure to do so.
First, here’s the raw code:
var exploreLocation, downloadUrl
if(document.location.pathname.match(/^\/explore\//)){
exploreLocation = document.location
}
if(document.location.pathname.match(/^\/looks\//)){
exploreLocation = document.querySelector(".link-bar a[href^='/explore']")
}
if(document.location.pathname.match(/^\/dashboards\/\d+$/)){
downloadUrl =
document.location.pathname
+ "/downloadzip"
+ "?"
+ (document.location.search.slice(1).split("&").filter(s=>s.indexOf("filter_config=")==0)[0]||"").replace(/^filter_config/,"filters")
}
if(exploreLocation){
var downloadUrl =
exploreLocation.pathname
+ ".csv"
+ exploreLocation.search
+ "&apply_formatting=true&apply_vis=true&limit=-1&download=yes";
}
if(downloadUrl){
document.location.href=downloadUrl
}else{
alert("No download logic available for this type of page")
}
And here’s that code with linebreaks removed to make it easier to copy in to a bookmarklet:
javascript: var exploreLocation, downloadUrl; if(document.location.pathname.match(/^\/explore\//)){ exploreLocation = document.location } if(document.location.pathname.match(/^\/looks\//)){ exploreLocation = document.querySelector(".link-bar a[href^='/explore']") } if(document.location.pathname.match(/^\/dashboards\/\d+$/)){ downloadUrl = document.location.pathname + "/downloadzip" + "?" + (document.location.search.slice(1).split("&").filter(s=>s.indexOf("filter_config=")==0)[0]||"").replace(/^filter_config/,"filters") } if(exploreLocation){ var downloadUrl = exploreLocation.pathname + ".csv" + exploreLocation.search + "&apply_formatting=true&apply_vis=true&limit=-1&download=yes"; } if(downloadUrl){ document.location.href=downloadUrl }else{ alert("No download logic available for this type of page") }
