none
Referencing a drive address such as Google drive or dropbox RRS feed

  • Question


  • Hi Folks

    I want other users of power query to be able to access  data from a shared drive such as Google Drive or Dropbox. So for example I have a file located at the following address in dropbox

    C:\Users\Steve\Dropbox (Business_Name)\Business Intelligence Raw files\test.csv

    The first part of the address will change with other users. So for a colleague with dropbox the address might be 

    D:\Users\Bob\Dropbox (Business_Name)\Business Intelligence Raw files\test.csv

    Is there a way to reference  such a drive with Power Query?

    Cheers

    Steve



    Sunday, July 6, 2014 9:00 PM

Answers

  • Hi Steve,

    There is no "built-in" way to programmatically retrieve the current user directory in PQ. However, an alternative solution would be to parameterize your query so that users are asked to specify the path to their directory when running the query.

    You can achieve this by adding a parameter to your query (via the View -> Advanced Editor dialog inside the Query Editor):

    (userPath as text) =>
    let
        Source = Table.FromColumns({Lines.FromBinary(File.Contents(userPath & "Dropbox (Business_Name)\Business Intelligence Raw files\test.csv"),null,null,1252)})
    in
        Source

    When running the query, users will be prompted to specify userPath, as showed below:

    Hope this helps.

    M.



    Monday, July 7, 2014 3:15 PM

All replies

  • Hi Steve,

    There is no "built-in" way to programmatically retrieve the current user directory in PQ. However, an alternative solution would be to parameterize your query so that users are asked to specify the path to their directory when running the query.

    You can achieve this by adding a parameter to your query (via the View -> Advanced Editor dialog inside the Query Editor):

    (userPath as text) =>
    let
        Source = Table.FromColumns({Lines.FromBinary(File.Contents(userPath & "Dropbox (Business_Name)\Business Intelligence Raw files\test.csv"),null,null,1252)})
    in
        Source

    When running the query, users will be prompted to specify userPath, as showed below:

    Hope this helps.

    M.



    Monday, July 7, 2014 3:15 PM
  • Thanks !
    Monday, July 14, 2014 9:51 PM