Forum Discussion
matheusmelillo
1 year agoNew Member
Transform A List of Records into a Table
Hello, Im kinda new to API sources in PowerBi and I'm sutck in the following situation: I get from a API a JsonDocument with list of records with many lines: Each of this records loo...
- 1 year ago
Have you tried Table.FromRecords?
With a 'Source' similar toTable.FromRecords(Source)gets you...
If you only want specific fields from the records you can add a step after the source.
As an example choosing the first and third columns would end up with this example code...
let Source = { [First="value from row 1 column 1", Second="value from row 1 column 2", Third="value from row 1 column 3", Forth="value from row 1 column 4"], [First="value from row 2 column 1", Second="value from row 2 column 2", Third="value from row 2 column 3", Forth="value from row 2 column 4"], [First="value from row 3 column 1", Second="value from row 3 column 2", Third="value from row 3 column 3", Forth="value from row 3 column 4"], [First="value from row 4 column 1", Second="value from row 4 column 2", Third="value from row 4 column 3", Forth="value from row 4 column 4"] }, select_fields = List.Transform(Source, each Record.SelectFields(_, {"First", "Third"})), convert_to_table = Table.FromRecords(select_fields) in convert_to_tableend a result of...
- 1 year ago
=Table.FromRecords(yourRecordList,Record.FieldNames(yourRecordList{0}),2)
Anonymous
1 year agoNot applicable
Hi matheusmelillo,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by the community members for the issue worked. If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Thanks and regards