let
payload = "{""columns"":[""name"",""description"",""logoid"",""update_mode"",""type"",""typespecs"",""change|1"",""change|5"",""change|15"",""change|60"",""change|240"",""change"",""change|1W"",""change|1M"",""Perf.3M"",""Perf.6M"",""Perf.YTD"",""Perf.Y"",""beta_1_year"",""Volatility.D""],""filter"":[{""left"":""is_primary"",""operation"":""equal"",""right"":true},{""left"":""typespecs"",""operation"":""has"",""right"":""common""},{""left"":""type"",""operation"":""equal"",""right"":""stock""},{""left"":""name"",""operation"":""nempty""}],""filterOR"":[],""ignore_unknown_fields"":false,""options"":{""active_symbols_only"":true,""lang"":""tr""},""price_conversion"":{},""range"":[0,100],""sort"":{""sortBy"":""name"",""sortOrder"":""asc""},""symbols"":{""query"":{""types"":[]},""tickers"":[]},""markets"":[""turkey""]}",
jsonColumns = List.Select(Record.Field(Json.Document(payload),"columns"), each _ <> "typespecs"),
Source = Json.Document(Web.Contents("https://scanner.tradingview.com/turkey/scan", [Headers=[Accept="application/json", #"Content-Type"="text/plain;charset=UTF-8"],Content=Text.ToBinary(payload)])),
data = Source[data],
#"Converted to Table" = Table.FromList(data, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"s", "d"}, {"Column1.s", "Column1.d"}),
#"Added Custom" = Table.AddColumn(#"Expanded Column1", "Custom", each Table.Transpose(Table.FromList(List.Select([Column1.d], each Value.Is(_, type list) = false), Splitter.SplitByNothing(), null, null, ExtraValues.Error),jsonColumns)),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Column1.d"}),
#"Expanded Custom" = Table.ExpandTableColumn(#"Removed Columns", "Custom", {"name", "description", "logoid", "update_mode", "type", "change|1", "change|5", "change|15", "change|60", "change|240", "change", "change|1W", "change|1M", "Perf.3M", "Perf.6M", "Perf.YTD", "Perf.Y", "beta_1_year", "Volatility.D"}, {"name", "description", "logoid", "update_mode", "type", "change|1", "change|5", "change|15", "change|60", "change|240", "change", "change|1W", "change|1M", "Perf.3M", "Perf.6M", "Perf.YTD", "Perf.Y", "beta_1_year", "Volatility.D"}),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded Custom",{{"name", type text}, {"description", type text}, {"logoid", type text}, {"update_mode", type text}, {"type", type text}, {"change|1", type number}, {"change|5", type number}, {"change|15", type number}, {"change|60", type number}, {"change|240", type number}, {"change", type number}, {"change|1W", type number}, {"change|1M", type number}, {"Perf.3M", type number}, {"Perf.6M", type number}, {"Perf.YTD", type number}, {"Perf.Y", type number}, {"beta_1_year", type number}, {"Volatility.D", type number}})
in
#"Changed Type"