Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I'm a bit of a noobie to PBI; I have transformed my data in advanced editor and everything looks great; data is a list of records retrieved using web.contents() function.
Preview Table:
***************
| n | i1 | i2 | t1 | t2 | d | c | c_flat |
| 0 | 0 | 0 | 1683379116 | 1683379116 | 0 | [List] | ISUZU D-MAX (BFS 921-M),BFS-921,Southern,LA,MFS |
| 1 | 0 | 0 | 1683361191 | 1683361191 | 0 | [List] | Toyota Hilux (FAC 645),FAC-645,Southern,NY,BUSINESS SOLUTIONS |
sample PBI query using web.contents():
******************************************
let
sessionID = Text.From(xyz),
prefix = URL,
Source = Json.Document(Web.Contents(prefix & sessionID)),
Flattened = List.Transform(Source, each Record.AddField(_, "c_flat", Text.Combine([c], ","))),
Result = Table.FromRecords(Flattened)
in
Result
data is transformed in advanced editor no problems; when i click "apply" to save preview to model; i get "We cannot convert a value of type Record to type List" error; I cannot for the life of me overcome is error.
When i load the data directly into script instead of pulling via web.contents() the data is transformed as expected and preview table can be "apply" saved to model
sample script without web.contents():
***************************************
let
Source = Json.Document("[{""n"":0,""i1"":0,""i2"":0,""t1"":1683379116,""t2"":1683379116,""d"":0,""c"":[""ISUZU D-MAX (BFS 921-M)"",""BFS-921"",""Southern"",""LA"",""MFS""]},{""n"":1,""i1"":0,""i2"":0,""t1"":1683361191,""t2"":1683361191,""d"":0,""c"":[""Toyota Hilux (FAC 645)"",""FAC-645"",""Southern"",""NY"",""BUSINESS SOLUTIONS""]}]"),
Flattened = List.Transform(Source, each Record.AddField(_, "c_flat", Text.Combine([c], ","))),
Result = Table.FromRecords(Flattened)
in
Result
sample json data:
*******************
[{"n":0,"i1":0,"i2":0,"t1":1683379116,"t2":1683379116,"d":0,"c":["ISUZU D-MAX (BFS 921-M)","BFS-921","Southern","LA","MFS"]},{"n":1,"i1":0,"i2":0,"t1":1683361191,"t2":1683361191,"d":0,"c":["Toyota Hilux (FAC 645)","FAC-645","Southern","NY","BUSINESS SOLUTIONS"]}]
I'm thinking the web.content() function has a limitation when handling a list of records. Any suggetions and work arounds would be greatly appreciated...cheers
HI @Anonymous,
I copy your sample data and find these testing data can be correctly recognized and expanded these records in query editor side.
Can you please share some sample data with more complex records? They may cause the issue to recognize when your records nested different structures.
Notice: these query steps are recognized and auto generated by data connecting steps.
Regards,
Xiaoxin Sheng
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 37 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 89 | |
| 73 | |
| 66 | |
| 65 |