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