0% found this document useful (0 votes)
52 views2 pages

Custom Connector

The TripPinConnector.pq file contains the logic for a data connector that retrieves airport information from the TripPin OData service. It includes functions to expand and transform the data into a structured table format. Additionally, the TripPinConnector provides UI publishing details and icon resources for integration with applications like Power BI.

Uploaded by

srikanth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views2 pages

Custom Connector

The TripPinConnector.pq file contains the logic for a data connector that retrieves airport information from the TripPin OData service. It includes functions to expand and transform the data into a structured table format. Additionally, the TripPinConnector provides UI publishing details and icon resources for integration with applications like Power BI.

Uploaded by

srikanth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

TripPinConnector.

pq file

// This file contains your Data Connector logic


section TripPinConnector;

[[Link]="TripPinConnector", Publish="[Link]"]
shared [Link] = (optional message as text) =>
let
airports = GetAirports(),
#"Expanded Airport" = [Link](airports, "Column1",
{"IcaoCode", "Name", "IataCode", "Location"}, {"IcaoCode", "Name", "IataCode",
"Location"}),
#"Expanded Location" = [Link](#"Expanded Airport",
"Location", {"Address", "City", "Loc"}, {"Address", "City", "Loc"}),
#"Expanded City" = [Link](#"Expanded Location", "City",
{"CountryRegion", "Name", "Region"}, {"CountryRegion", "Name.1", "Region"}),
#"Expanded Loc" = [Link](#"Expanded City", "Loc", {"type",
"coordinates", "crs"}, {"type", "coordinates", "crs"}),
#"Extracted Values" = [Link](#"Expanded Loc", {"coordinates",
each [Link]([Link](_, [Link]), ","), type text}),
#"Expanded crs" = [Link](#"Extracted Values", "crs",
{"properties"}, {"properties"}),
airportsDetail = [Link](#"Expanded crs", "properties",
{"name"}, {"crs"})
in
airportsDetail;

GetAirports = () as table =>


let
DefaultRequestHeaders = [
#"Accept" = "application/json;[Link]=minimal",
#"OData-MaxVersion" = "4.0"
],
source =
[Link]("[Link]
[ Headers=DefaultRequestHeaders ]),
json = [Link](source),
value = json[value],
toTable = [Link](value, [Link](), null, null,
[Link])
in
toTable;

// Data Source Kind description


TripPinConnector = [
Authentication = [
// Key = [],
// UsernamePassword = [],
// Windows = [],
Implicit = []
],
Label = [Link]("DataSourceLabel")
];

// Data Source UI publishing description


[Link] = [
Beta = true,
Category = "Other",
ButtonText = { [Link]("ButtonTitle"),
[Link]("ButtonHelp") },
LearnMoreUrl = "[Link]
SourceImage = [Link],
SourceTypeImage = [Link]
];

[Link] = [
Icon16 = { [Link]("[Link]"),
[Link]("[Link]"),
[Link]("[Link]"),
[Link]("[Link]") },
Icon32 = { [Link]("[Link]"),
[Link]("[Link]"),
[Link]("[Link]"),
[Link]("[Link]") }
];

[Link] file

// Use this file to write queries to test your data connector


let
result = [Link]()
in
result

You might also like