Forum Discussion
heriberto_mb
2 years agoFrequent Visitor
PowerBI Power Query "We cannot apply field access to the type Binary"
I need a hand trying to find why I am receiving "We cannot apply field access to the type Binary " This is the function that I've defined, I've removed the token and the directory name for secur...
- 2 years ago
What's the Text.FromBinary for? Not needed.
token=Json.Document(Data)[token]
heriberto_mb
2 years agoFrequent Visitor
It works now! Here is the adjustment I did:
let gettoken=() =>
let
JWT="<my_token>",
vContent=Text.ToBinary("{""query"": ""{ organization(login: \""github\"") { name }}""}"),
Data= Web.Contents("https://api.github.com/app/installations/<id>/access_tokens",
[
Headers=[
#"Accept"="application/vnd.github+json",
#"Authorization"="Bearer " & JWT,
#"X-GitHub-Api-Version"="2022-11-28",
#"Content-Type"="application/x-www-form-urlencoded"
],Content=vContent])
,token=Json.Document(Data)[token]
in
token
in gettoken