Forum Discussion
Connecting to data source hosted on Dropbox
Hi Mike,
having difficulties to follow you here: What do you mean with "App folder"?
To my understanding you need to create an App in Dropbox to be able to generate an API-key. For the use in PBI you don't need the Dropbox-app explicitely, just the key/token.
The folder you can choose is just a "normal" folder in the dropbox.
But I might be totalally mistaken here, actually I don't use this myself.
In your post you put the files inside the App folder so assumed you had to do that. I'll go and try with a normal dropbox folder. and report back
- ImkeF9 years agoCommunity Champion
Folder need to start with a slash:
- masplin9 years agoImpactful Individual
Ok so I used your code and token I had got for the whole of my dropbox. If I put no folder path I get somethnig
However i need a folder that is several layers down Datamodel/3rd party Bookings/WCFMC
If i put in anything in the folder bit it errors
An error occurred in the ‘Query1’ query. DataSource.Error: Web.Contents failed to get contents from 'https://api.dropboxapi.com/2/files/list_folder' (400): Bad Request
Details:
DataSourceKind=Web
DataSourcePath=https://api.dropboxapi.com/2/files/list_folder
Url=https://api.dropboxapi.com/2/files/list_folderAny ideas how to get it to read the contents of subfolders?
Thnaks
Mike
- masplin9 years agoImpactful Individual
Ah perfect. looks like its working. Fantastic.
your the best
Mike
- masplin9 years agoImpactful Individual
Sadly the previous poster is correct. your method works within excel and PowerQuery, but you cannot use that same query in PDI Desktop as fails on the gateway
That is really annoying.
Mike
- masplin9 years agoImpactful Individual
The code is fine to use within excel to query a dropbox folder. If you put that same query in PBI desktop and then publish to Power BI Service it fails.
I just spend hours getting it working in Excel, replaced everythnig in PBI and then had to reverse it all out!!! Very frustrating.
Mike
- ImkeF9 years agoCommunity Champion
Yes, there are many things that don't work in the service unfortunately.
- masplin9 years agoImpactful Individual
I'll check to see if anyone raised this to be voted on and if not add it.
- masplin9 years agoImpactful Individual
I think this is the best one for us to vote on
https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/6663925-dropbox
- Anonymous9 years agoNot applicable
I already voted. Thanks for the link.
So far, the only way to make PBI Service work is loading single files using the code from user Masplin.
3rd comment on 3rd page of this same topic.
- masplin9 years agoImpactful Individual
Ok so plan B. The out of the box method in power Query for querying a folder is create this big mess with sample files that is tremendusly confusing. Is there a way to just have a single qury that does the job?
For example I want to query these 2 files in a dropbox folder. The first step I see this
However if i click the arrows on binary it sets off greating the sample file.
Can I get round this with some code similar to what Imke wrote for dropbox? I assume it is a similar exercise but my M is too pooor to work it out :(
Mike
- masplin9 years agoImpactful Individual
Found it :)
https://www.myexcelonline.com/blog/consolidate-multiple-excel-workbooks-using-power-query/
- JAkerblom8 years agoFrequent Visitor
ImkeF, No I don't have a gateway installed. Didn't understand why I'd need one to make a specific API call.
I see now that people need to specifically list folder contents and not just go for a specific file, which is what I did. First I thought it was the api method that couldn't provide that list results of folder contents, but when I tried to just do a command line curl call it worked just fine, i.e. the list_folder method can return the list of folder contents (but just not in PowerBI Desktop for some reason..). I tried all types of header parameters in the web.contents method to make it work, but I didn't succeed. Either I'm doing it wrong or it's just not possible. But it would be really strange if certain API calls just don't work.