let
GetAuth = Web.Contents("https://AcceleratorKMS_URL/token",
[
Headers = [#"Accept"="application/json",
#"Content-Type"="application/x-www-form-urlencoded;charset=UTF-8"],
Content = Text.ToBinary("username=MyUserName&password=MyPassword&grant_type=password")
]),
FormatAuthAsJson = Json.Document(GetAuth),
access_token = FormatAuthAsJson[access_token],
ReportData = Json.Document(Web.Contents("https://AcceleratorKMS_URL/api/Completions/Search",
[
Headers=[Authorization="bearer "&access_token,
#"Content-Type"="application/json; charset=utf-8"]
,Content = Text.ToBinary("{""SearchTerm"": ""EVAP123 - Evaporator - Shutdown"", ""LimitSearchResults"":10}")
])),
#"Converted Data To Table" = Table.FromList(ReportData, Splitter.SplitByNothing(),
null, null, ExtraValues.Error),
ColumnNames = List.Union( List.Transform(#"Converted Data To Table"[Column1], each
Record.ToTable(_)[Name])),
#"Expanded Report Data" = Table.ExpandRecordColumn(#"Converted Data To Table", "Column1",
ColumnNames)
in
#"Expanded Report Data"