I'm a beginner with power query and I've been working on this code to pull an entity by invoking the entityID.
When I enter the entity ID, I'm getting an error. Appreciate all the help that I can get from the community
An error occurred in the ‘’ query. Expression.Error: We cannot convert a value of type Record to type Number.
Details:
Value=[Record]
Type=[Type]
Here is the code that I have produced and there was no syntax error.
(entityIds as text) as table =>
let
Source = Json.Document(Web.Contents("https://xxxx.com/xxxx/xxxxx",
[RelativePath ="entities/"&entityIds&"/fieldvalues"]),
[Headers=[Accept="application/json", #"Authentication"=APIKey]]),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"fieldTypeId", "value"}, {"fieldTypeId", "value"}),
#"Transposed Table" = Table.Transpose(#"Expanded Column1"),
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
#"Expanded ProductDisplayName" = Table.ExpandRecordColumn(#"Promoted Headers", "ProductDisplayName", {"en"}, {"ProductDisplayName.en"}),
#"Expanded ProductDescriptionShort" = Table.ExpandRecordColumn(#"Expanded ProductDisplayName", "ProductDescriptionShort", {"en"}, {"ProductDescriptionShort.en"}),
#"Expanded ProductDescription" = Table.ExpandRecordColumn(#"Expanded ProductDescriptionShort", "ProductDescription", {"en"}, {"ProductDescription.en"}),
#"Expanded ProductUSP" = Table.ExpandRecordColumn(#"Expanded ProductDescription", "ProductUSP", {"en"}, {"ProductUSP.en"}),
#"Extracted Values" = Table.TransformColumns(#"Expanded ProductUSP", {"ProductMarket", each Text.Combine(List.Transform(_, Text.From)), type text}),
#"Expanded ProductApplication" = Table.ExpandRecordColumn(#"Extracted Values", "ProductApplication", {"en"}, {"ProductApplication.en"}),
#"Expanded ProductKeywords" = Table.ExpandRecordColumn(#"Expanded ProductApplication", "ProductKeywords", {"en"}, {"ProductKeywords.en"})
in
#"Expanded ProductKeywords"