Forum Discussion

robertpedley1's avatar
robertpedley1
New Member
5 years ago
Solved

Unexpected error when trying to add data from csv to CDS

Hi I have a simple csv that is stored in one drive that I want to use dataflow (power query) to add to a table I have in the CDS. When i get to the last step i get an error:   section Section1; sh...
  • edhans's avatar
    5 years ago

    Because a CSV stored on your hard drive would have this source line:

    Source = Csv.Document(File.Contents("C:\Users\path\Book2.csv"),[Delimiter=",", Columns=3, Encoding=65001, QuoteStyle=QuoteStyle.None])

    You have Web.Contents, so it looks like you are opening the file from a onedrive path in a web page, and web pages require a gateway.

    If it is onedrive for Business, use the SharePoint connector. Go to OneDrive in your browser in your Office 365 (business) tenant and grab the URL. It will look like this:

    https://TenentName-my.sharepoint.com/personal/user_name_tenentname_com/

    Put that in a SharePoint Folder connector and get your file. 

    That will not work with OneDrive personal, only business accounts.