cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Syndicate_Admin
Administrator
Administrator

We cannot convert a value of type Record to type Number

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"

0 REPLIES 0

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,939)