I am using the following code in my own powerBI Data connector to get some date from a json document:
{
"Customers": [
{
"CustomerId": "8cd72f16-8d7b-48b0-90d9-71df011502c8",
"CustomerTitle": "Test Customer",
}
}
Code:
GetCustomerTable = (url as text) as table =>
let
source = Test.Feed(url & "/overview"),
value = source[Customers],
toTable = Table.FromList(value, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"expandColumn" = Table.ExpandRecordColumn(toTable, "Column1", {"CustomerId", "CustomerTitle"}, {"CustomerId", "CustomerTitle"}),
#"ChangedType" = Table.TransformColumnTypes(#"expandColumn",{{"CustomerTitle", type text}, {"CustomerId", type text})
in
ChangedType;
The column "CustomerId" referes to another url where the actual data about the customer is available in json format:
URL: /Details/8cd72f16-8d7b-48b0-90d9-71df011502c8
{
"Category": "B",
}
What is the best approach to use data from another url with the ExpandRecordColumn
function?