Skip to content

Instantly share code, notes, and snippets.

View JanPelisek's full-sized avatar

Jan Pelíšek JanPelisek

View GitHub Profile
let
Source = YourCustomConnectorName.Contents("<https://my.api.endpoint/product>")
in
Source
NavTable = (url as text) as table =>
let
source = #table({"Name", "Data", "ItemKind", "ItemName", "IsLeaf"}, {
{ "Airlines", GetAirlinesTable(url), "Table", "Table", true },
{ "Airports", GetAirportsTable(url), "Table", "Table", true }
}),
navTable = Table.ToNavigationTable(source, {"Name"}, "Name", "Data", "ItemKind", "ItemName", "IsLeaf")
in
navTable;
Type = type function (
message1 as (type text meta [
Documentation.FieldCaption = "Message 1",
Documentation.FieldDescription = "Text to display for message 1",
Documentation.SampleValues = {"Hello world"},
Formatting.IsMultiLine = true,
Formatting.IsCode = true
]),
message2 as (type text meta [
Documentation.FieldCaption = "Message 2",
apiKey = Extension.CurrentCredential()[Key];
DefaultRequestHeaders = [
#"Authorization" = "Bearer " & apiKey,
Accept = "application/vnd.api+json",
#"Content-Type" = "application/json"
];
myListOfEndpoints = {
"<https://my.api.endpoint/product>"
"<https://my.api.endpoint/sales>"
"<https://my.api.endpoint/store>"
YourCustomConnectorName.Icons = [
Icon16 = { Extension.Contents("Logo16.png"), Extension.Contents("Logo20.png"), Extension.Contents("Logo24.png"), Extension.Contents("Logo32.png")},
Icon32 = { Extension.Contents("Logo32.png"), Extension.Contents("Logo40.png"), Extension.Contents("Logo48.png"), Extension.Contents("Logo64.png")}
];
YourCustomConnectorName.Publish = [
Beta = true,
Category = "Other",
ButtonText = { "YourCustomConnectorName", "Import data from YourCustomConnectorName" },
SourceImage = YourCustomConnectorName.Icons,
SourceTypeImage = YourCustomConnectorName.Icons
];
YourCustomConnectorName = [
Authentication = [
Key = [
KeyLabel = 'API Key'
Label = ' API Key'
]
],
Label = 'YourCustomConnectorName'
];