Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
Trying to create a pretty simple custom connector for Power BI. .pq code is listed below and I have attached the .mez file. The idea for the connector is to connect to a folder and pull back all of the files in the folder (CSV files) and allow you to choose which files you want and each becomes its own query. The current problem I have is that my Windows credentials are not associating with my selected folder. So, when I use the connector the following happens:
1. Prompts me for a folder path
2. Prompts me for credentials
3. Errors and tells me I need to provide credentials or "Please specifyhow to connect"
I'm sure it's something silly and easy but I can't figure it out.
// This file contains your Data Connector logic
[Version = "1.0.0"]
section TDGTPQM_FolderFile;
TDGTPQM_FolderFile.GetFile = ( filePath as text) as table =>
let
output = Csv.Document(File.Contents(filePath),[Delimiter=",", Encoding=1252, QuoteStyle=QuoteStyle.None])
in
output;
[DataSource.Kind="TDGTPQM_FolderFile", Publish="TDGTPQM_FolderFile.Publish"]
shared TDGTPQM_FolderFile.Contents = ( folder as text ) =>
let
//Credential = Extension.CurrentCredential(),
files =
Table.DuplicateColumn(
Table.CombineColumns(
Table.SelectColumns(
Folder.Contents( folder ),
{ "Name", "Folder Path"}
),
{ "Folder Path", "Name" },
Combiner.CombineTextByDelimiter("", QuoteStyle.None),
"Name"
),
"Name",
"Key"
),
addDataColumn = Table.AddColumn( files, "Data", each TDGTPQM_FolderFile.GetFile([Key])),
addItemKindColumn = Table.AddColumn( addDataColumn, "ItemKind", each "Table"),
addItemNameColumn = Table.AddColumn( addItemKindColumn, "ItemName", each "Table"),
addIsLeafColumn = Table.AddColumn( addItemNameColumn, "IsLeaf", each true),
Navigation = Table.ToNavigationTable( addIsLeafColumn, {"Key"}, "Name", "Data", "ItemKind", "ItemName", "IsLeaf")
in
Navigation;
// Data Source Kind description
TDGTPQM_FolderFile = [
TestConnection = ( dataSourcePath ) => { "TDGTPQM_FolderFile.Contents" },
Authentication = [
// Key = [],
//UsernamePassword = [],
Windows = [ SupportsAlternateCredentials = true ]
//Anonymous = []
]
];
// Data Source UI publishing description
TDGTPQM_FolderFile.Publish = [
Beta = true,
Category = "Other",
ButtonText = { Extension.LoadString("ButtonTitle"), Extension.LoadString("ButtonHelp") },
LearnMoreUrl = "https://powerbi.microsoft.com/",
SourceImage = TDGTPQM_FolderFile.Icons,
SourceTypeImage = TDGTPQM_FolderFile.Icons
];
TDGTPQM_FolderFile.Icons = [
Icon16 = { Extension.Contents("TDGTPQM_FolderFile16.png"), Extension.Contents("TDGTPQM_FolderFile20.png"), Extension.Contents("TDGTPQM_FolderFile24.png"), Extension.Contents("TDGTPQM_FolderFile32.png") },
Icon32 = { Extension.Contents("TDGTPQM_FolderFile32.png"), Extension.Contents("TDGTPQM_FolderFile40.png"), Extension.Contents("TDGTPQM_FolderFile48.png"), Extension.Contents("TDGTPQM_FolderFile64.png") }
];
Table.ToNavigationTable = (
table as table,
keyColumns as list,
nameColumn as text,
dataColumn as text,
itemKindColumn as text,
itemNameColumn as text,
isLeafColumn as text
) as table =>
let
tableType = Value.Type(table),
newTableType = Type.AddTableKey(tableType, keyColumns, true) meta
[
NavigationTable.NameColumn = nameColumn,
NavigationTable.DataColumn = dataColumn,
NavigationTable.ItemKindColumn = itemKindColumn,
Preview.DelayColumn = itemNameColumn,
NavigationTable.IsLeafColumn = isLeafColumn
],
navigationTable = Value.ReplaceType(table, newTableType)
in
navigationTable;
Hi @Greg_Deckler ,
Could you please try the following steps and check if can solve your problem?
Best Regards
@Anonymous Thanks but did not work. My fear is that Folder.Contents is not supported: Custom connector for proprietary file type - Microsoft Fabric Community
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 |