Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Errors in M Query output

Hi, I am trying to make an XML custom connector, so that when I connect to that file all the transformations are done.

My project name is XMLConnector
This is my XMLConnector.pq code

section XMLConnector;

[DataSource.Kind="XMLConnector", Publish="XMLConnector.Publish"]
shared XMLConnector.Contents  = (path as text) =>
       let
            Source = Xml.Tables(File.Contents(path))
       in
            Source;
// Data Source Kind description
XMLConnector = [
   Authentication = [
    Anonymous = []
],
    Label = Extension.LoadString("DataSourceLabel")
];

This is my XMLConnector.query.pq

let
    Source = XMLConnector.Contents("C:\MyFile.xml")
in
    Source

When I try to run this app, I am getting M query error as follows:

  • Data Source Kind
    File
  • Data Source Path
    C:\MyFile.xml
  • Credential Type
    Windows
  • Privacy
    None
  • Username(o)
  • Password(o)
  • IdentitySource(o)
    What should I provide in these fields?

Thanks in advance.