Extension.Contents is a Power Query M function that loads a binary resource, identified by name or path, from within the extension.
Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365
Syntax
Extension.Contents( file as text ) as binary
Examples
Here’s an example connector that uses the Extension.Contents function:
section HelloWorld;
[DataSource.Kind="HelloWorld", Publish="HelloWorld.Publish"]
shared HelloWorld.Contents = (optional message as text) =>
let
message = if (message <> null) then message else "Hello world"
in
message;
HelloWorld = [
Authentication = [
Implicit = []
],
Label = Extension.LoadString("DataSourceLabel")
];
HelloWorld.Publish = [
Beta = true,
ButtonText = { Extension.LoadString("FormulaTitle"), Extension.LoadString("FormulaHelp") },
SourceImage = HelloWorld.Icons,
SourceTypeImage = HelloWorld.Icons
];
HelloWorld.Icons = [
Icon16 = { Extension.Contents("HelloWorld16.png"), Extension.Contents("HelloWorld20.png"), Extension.Contents("HelloWorld24.png"), Extension.Contents("HelloWorld32.png") },
Icon32 = { Extension.Contents("HelloWorld32.png"), Extension.Contents("HelloWorld40.png"), Extension.Contents("HelloWorld48.png"), Extension.Contents("HelloWorld64.png") }
];
Related articles
Learn more about Extension.Contents in the following articles:
- Creating your first connector: Hello World
This article shows how to create a basic custom connector. » Read more
Related functions
Other functions related to Extension.Contents are:
- Extension.Cache
- Extension.CredentialError
- Extension.CurrentApplication
- Extension.CurrentCredential
- Extension.HasPermission
- Extension.InvokeVolatileFunction
- Extension.InvokeWithCredentials
- Extension.InvokeWithPermissions
- Extension.LoadString
- Extension.Module
- Extension.State
2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy