Forum Discussion
bottos
2 years agoFrequent Visitor
Trouble converting list into text (JSON and Azure Cognitive Services)
Hi. I am not sure what I am doing wrong, so any help will be greatly appreciated. I am using the Azure Cognitive Services to translate a column with text. To do that, I have created a function as fo...
- 2 years ago
seems to work ok?
let Source = Json.Document("[ { ""translations"": [ { ""text"": ""Sequência de teste 1"", ""to"": ""pt"" } ] }, { ""translations"": [ { ""text"": ""Sequência de teste 2 "", ""to"": ""pt"" } ] } ]"), #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error), #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"translations"}, {"translations"}), #"Expanded translations" = Table.ExpandListColumn(#"Expanded Column1", "translations"), #"Expanded translations1" = Table.ExpandRecordColumn(#"Expanded translations", "translations", {"text", "to"}, {"text", "to"}) in #"Expanded translations1"
lbendlin
2 years agoSuper User
seems to work ok?
let
Source = Json.Document("[
{
""translations"": [
{
""text"": ""Sequência de teste 1"",
""to"": ""pt""
}
]
},
{
""translations"": [
{
""text"": ""Sequência de teste 2 "",
""to"": ""pt""
}
]
}
]"),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"translations"}, {"translations"}),
#"Expanded translations" = Table.ExpandListColumn(#"Expanded Column1", "translations"),
#"Expanded translations1" = Table.ExpandRecordColumn(#"Expanded translations", "translations", {"text", "to"}, {"text", "to"})
in
#"Expanded translations1"bottos
2 years agoFrequent Visitor
Thank you. Now I see what I was doing wrong.