Forum Discussion
Fabi66
3 years agoRegular Visitor
Power BI Expression.Error: We cannot convert a value of type Record to type Type. Details: Value=[Re
I get this error in Power BI: Expression.Error: We cannot convert a value of type Record to type Type. Details: Value=[Record] Type=[Type] When I try to use an existing column to query...
- 3 years ago
You could do it like this:
_BaseUri = "https://my.website.com/rest/api/candidates", //_RelativeUrl = , #"InvokeAPI" = Table.AddColumn(#"Removed Columns", "Results", each Json.Document( Web.Contents( _BaseUri, [ //RelativePath = _RelativeUrl, Headers=["Bearer xxxMyTokenxxx", #"Content-Type"="application/json"], Query=[CandidateId=[CandidateId]] ] ) ) )
jennratten
Super User
3 years agoYou could do it like this:
_BaseUri = "https://my.website.com/rest/api/candidates",
//_RelativeUrl = ,
#"InvokeAPI" = Table.AddColumn(#"Removed Columns", "Results", each Json.Document(
Web.Contents(
_BaseUri, [
//RelativePath = _RelativeUrl,
Headers=["Bearer xxxMyTokenxxx", #"Content-Type"="application/json"],
Query=[CandidateId=[CandidateId]]
]
)
)
)
Fabi66
3 years agoRegular Visitor
Finally got it to work using
#"Add APIQuery" = Table.AddColumn(#"Removed Columns", "APIQuery", each Json.Document(Web.Contents(
"https://www.xxx/rest/api/candidates/" & Text.From([CandidateId]) & "/?Fields=LastName&Custom=Source", [Headers=[Authorization="Bearer ***Token***", #"Content-Type"="application/json"]]
)
)
)
Thank you for your help!