This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
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
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |