Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi experts
I am building a PowerQuery Custom Connector (for Zoho APIs) in Visual Studio to be deployed to Power BI.
While debugging/launching from Visual Studio, I can see the data being fetched from the API; however, if I deploy the connector to the Power BI Custom Connectors folder, the same code doesn't work.
I get an error in Power BI while trying to use the Connector :
Details: "The field 'access_token' of the record wasn't found."
The snippet where I am accessing the token after the OAuth flow -
`...
token = GetToken(),
apiResponse = zoho.CallApi(apiEndpoint, token),
...
GetToken = () =>
let
access_token = Extension.CurrentCredential()[access_token]
in
access_token;
zoho.CallApi = (apiEndpoint as text, accessToken as text) =>
let
// Make API request using the access token
apiResponse = Json.Document(
Web.Contents(
apiEndpoint,
[Headers = [#"Authorization" = "Zoho-oauthtoken " & accessToken]]
)
)
in
apiResponse;
...
zoho = [
Authentication = [
OAuth = [
StartLogin=StartLogin,
FinishLogin=FinishLogin,
Refresh=Refresh,
Logout=Logout
]
]
];
//Implementations for StartLogin, FinishLogin, Refresh and Logout
`
Is there any restriction in invoking Extension.CurrentCredential() from Power BI (December 2023 version)?
The reason I need to fetch the access_token is because the Zoho APIs require the Authorization header to have the value : Zoho-oauthtoken <access_token>
Any ideas ?
Hi @arindamp
Please make sure that the access token is right,
e.g
MyConnector.Raw = (_url as text) as binary =>
let
apiKey = Extension.CurrentCredential()[Key],
headers = [
#"x-APIKey" = apiKey,
Accept = "application/vnd.api+json",
#"Content-Type" = "application/json"
],
request = Web.Contents(_url, [ Headers = headers, ManualCredentials = true ])
in
request
and you can refer to the following link.
Handling authentication for Power Query connectors - Power Query | Microsoft Learn
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
The access token name is right, as it all works fine from Visual Studio.
The issue only happens when the Connector has been deployed to Power BI.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.