Forum Discussion
Read an item in the List object in a table column
Hi,
I have list object with value as in one of the column in a table. I would like to fetch the item in the list where key is "isproduction" and i want to read the value of the "value" property i,e, true / false
[
{
"key": "teamprojecturl",
"value": "https://XXXXXXXX/xxxxxxx"
},
{
"key": "remarks",
"value": "Nice move"
},
{
"key": "isproduction",
"value": "true"
},
{
"key": "organizationalgroupname",
"value": "XXXXX-XXXXXXXX"
},
{
"key": "applicationci",
"value": "XXXXXXXXXXXXXXX"
},
{
"key": "region",
"value": "global"
},
{
"key": "requestedby",
"value": "[email protected]"
}
]
Thanks,
Vivek Kumar
Hi vivekk0312 ,
You could expand the list and filter it like below
let Source = Json.Document(File.Contents("C:\Users\<username>\Desktop\gantt.json")), #"Converted to Table" = Record.ToTable(Source), #"Expanded Value" = Table.ExpandListColumn(#"Converted to Table", "Value"), #"Expanded Value1" = Table.ExpandRecordColumn(#"Expanded Value", "Value", {"key", "value"}, {"key", "value.1"}), #"Filtered Rows" = Table.SelectRows(#"Expanded Value1", each ([key] = "isproduction")) in #"Filtered Rows"Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- dax
Community Support
Hi vivekk0312 ,
You could expand the list and filter it like below
let Source = Json.Document(File.Contents("C:\Users\<username>\Desktop\gantt.json")), #"Converted to Table" = Record.ToTable(Source), #"Expanded Value" = Table.ExpandListColumn(#"Converted to Table", "Value"), #"Expanded Value1" = Table.ExpandRecordColumn(#"Expanded Value", "Value", {"key", "value"}, {"key", "value.1"}), #"Filtered Rows" = Table.SelectRows(#"Expanded Value1", each ([key] = "isproduction")) in #"Filtered Rows"Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.