# Failed to update data source credentials: Value cannot be null. Parameter name:

**URL:** <https://community.hubspot.com/t/failed-to-update-data-source-credentials-value-cannot-be-null-parameter-name/13270>\
**Category:** APIs & Integrations\
**Tags:** oauth\
**Created:** [February 27, 2019, 10:41pm UTC](https://community.hubspot.com/t/failed-to-update-data-source-credentials-value-cannot-be-null-parameter-name/13270 "2019-02-27T22:41:33Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinoths](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/vinoths/32/28756_2.png) [@vinoths](https://community.hubspot.com/u/vinoths)\
**Post date:** [February 27, 2019, 10:41pm UTC](https://community.hubspot.com/t/failed-to-update-data-source-credentials-value-cannot-be-null-parameter-name/13270/1 "2019-02-27T22:41:33Z")

</div>

Hi,

When sigin through hubspot oauth2 in power bi gateway for schedule refresh , it throwing error as Failed to update data source credentials: Value cannot be null. Parameter name: uriString. Could you please advise.

extensiondatasourcepath :

[https://app.hubspot.com/oauth/authorize?client\_id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&scope=contacts%20files&access\_type=%22offline%22&include\_granted\_scopes=%22true%22&response\_type=%22code%22&redirect\_uri=https%3A%2F%2Fpreview.powerbi.com%2Fviews%2Foauthredirect.html](https://app.hubspot.com/oauth/authorize?client_id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&scope=contacts%20files&access_type=%22offline%22&include_granted_scopes=%22true%22&response_type=%22code%22&redirect_uri=https%3A%2F%2Fpreview.powerbi.com%2Fviews%2Foauthredirect.html)

extensionDataSourceKind: Hubspot

AuthenticationMethod: Oauth2

Thanks

Vinoth SUSAINATHAN

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [March 1, 2019, 4:45pm UTC](https://community.hubspot.com/t/failed-to-update-data-source-credentials-value-cannot-be-null-parameter-name/13270/2 "2019-03-01T16:45:00Z")

</div>

Hi, @vinoths.

Could you try two things and see if either of them allow you to connect the app?

1. Remove `&access_type=%22offline%22&include_granted_scopes=%22true%22&response_type=%22code%22` from the authentication URL so that the only parameters are `client_id`, `scope`, and `redirect_uri`, are included, per [this article](https://developers.hubspot.com/docs/methods/oauth2/initiate-oauth-integration). This is to reduce the number of variables in the test.
2. Unencode `https%3A%2F%2Fpreview.powerbi.com%2Fviews%2Foauthredirect.html` so that it appears listed as `redirect_uri=https://preview.powerbi.com/views/oauthredirect.html`. Per the article I listed above and all other examples I’ve seen, I have never seen encoded `redirect_uri` values work.

---

<div class="post-metadata">

**Author:** ![vinoths](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/vinoths/32/28756_2.png) [@vinoths](https://community.hubspot.com/u/vinoths)\
**Post date:** [March 4, 2019, 1:19pm UTC](https://community.hubspot.com/t/failed-to-update-data-source-credentials-value-cannot-be-null-parameter-name/13270/3 "2019-03-04T13:19:32Z")

</div>

Hi Isaac,

Thank you for your reply. I have tried the two things that you mentioned above, it still getting the same error message.

I tried to authenticate below,

 ![1.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/5/56835520b902782315f64527a52a6d5646355a7c.png)

Error Message

Failed to update data source credentials: Value cannot be null. Parameter name: uriString

Steps to reproduce:

I tried to set the schedule reresh, so prior to that it has to do update datasource credentials in power bi online service  
When i try to update data source credentials of hubspot oauth2, It throwing the error. I unable to locate the issue where it has been. Could you please advise.

In Power Bi online Service → Dataset →

 ![1.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/8/86ff4cd514f0840da89fac81d5d9a1eaaaf9f0c2.png)

When i click edit credentials in hubspot datasource

I selected Upply

 ![1.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/4/c/4ccaf5b579b5fa5c7142d5aa7d6234ee274ad65b.png)

I redirected to the below url

 ![1.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/f/4/f488a7540387d9f222c8d3e3f89b38724bcd509e.png)

I got the below error,

 ![1.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/e/eb4c8217117ecb5c8a418cb6b37546174379cc76.png)

Thanks

Vinoth S

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [March 5, 2019, 3:16pm UTC](https://community.hubspot.com/t/failed-to-update-data-source-credentials-value-cannot-be-null-parameter-name/13270/4 "2019-03-05T15:16:19Z")

</div>

Hi, @vinoths.

I would like to take a step back so I can fully understand the situation.

Are you trying to build a custom integration between HubSpot and [Microsoft Power BI](https://powerbi.microsoft.com/en-us/)? If so, is [this](https://app.hubspot.com/developer/5484279/application/188920) the HubSpot app you are working on? I see it is installed [here](https://app.hubspot.com/integrations-settings/4490686/installed) in account **4490686**.

If this is your custom integration, were you able to get [scheduled refreshes](https://docs.microsoft.com/en-us/power-bi/refresh-scheduled-refresh) to work before, or is this the first time you are trying to set them up?

---

<div class="post-metadata">

**Author:** ![vinoths](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/vinoths/32/28756_2.png) [@vinoths](https://community.hubspot.com/u/vinoths)\
**Post date:** [March 5, 2019, 5:04pm UTC](https://community.hubspot.com/t/failed-to-update-data-source-credentials-value-cannot-be-null-parameter-name/13270/5 "2019-03-05T17:04:16Z")

</div>

Hi,

Yes I am trying to build integration to power bi using rest api. The connection made successful and i got data from Hubspot. The problem is when i schedule automatic refresh, the hubspot data source credentials is not updated to the power bi and it throwing the error.

Thanks

Vinoth

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [March 7, 2019, 1:52pm UTC](https://community.hubspot.com/t/failed-to-update-data-source-credentials-value-cannot-be-null-parameter-name/13270/6 "2019-03-07T13:52:33Z")

</div>

Hi, @vinoths.

Thanks for clarifying. I am not experienced working with Power BI, but I’ll help as much as I can.

For others reading this thread, [this Power BI article](https://docs.microsoft.com/en-us/power-bi/refresh-data) on data refreshes has helped me contextualize Vinoth’s question.

@vinoths , could you clarify what you mean by “The connection made successful and i got data from Hubspot”? Are you referring to an initial sync, where your HubSpot data populated the Power BI report? Are you able to trigger a manual refresh by clicking **Refresh Now** or does that fail too?

If you are only able to get data _once_, then it sounds like your HubSpot OAuth credentials are expiring. Each access token expires after 6 hours. Can you confirm that your integration actively [refreshes its access tokens](https://developers.hubspot.com/docs/methods/oauth2/refresh-access-token) with your refresh token?

Hey, @johnelmer! I see from theads [like this](https://community.hubspot.com/t5/APIs-Integrations/Integrate-HubSpot-to-Power-BI-or-Prophix/m-p/239505) that your HubSpot Partner agency, [Bayard Bradford](https://www.bayardbradford.com/hubspot-power-bi-integration-sign-up/), built [this connector](https://www.hubspot.com/integrations/powerbi) between HubSpot and Power BI. I’m not asking you to help troubleshoot Vinoth’s issue, but am I missing any major facets of connecting HubSpot and Power BI? I’ll appreciate any insight!

---

<div class="post-metadata">

**Author:** ![johnelmer](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/johnelmer/32/55984_2.png) [@johnelmer](https://community.hubspot.com/u/johnelmer)\
**Post date:** [March 7, 2019, 3:51pm UTC](https://community.hubspot.com/t/failed-to-update-data-source-credentials-value-cannot-be-null-parameter-name/13270/7 "2019-03-07T15:51:08Z")

</div>

@IsaacTakushi,

Thanks for bringing me into this thread. Looking at what @vinoths has done, it appears he is trying to connect Power BI’s web service directly to HubSpot. That approach doesn’t work when trying to schedule automatic refreshing. It would be nice if it was that simple! (Disclaimer: This is the exact reason why we built our HubSpot connector for Power BI, described [here](https://www.hubspot.com/integrations/powerbi), which enables automatic refreshing on a scheduled basis.)

Glad to answer any more questions about this topic! There are a lot of options now for connecting HubSpot to Power BI, but it’s important to read the “fine print” to make sure the solution includes automatic refresh of HubSpot data in Power BI.

---

<div class="post-metadata">

**Author:** ![vinoths](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/vinoths/32/28756_2.png) [@vinoths](https://community.hubspot.com/u/vinoths)\
**Post date:** [March 11, 2019, 9:52am UTC](https://community.hubspot.com/t/failed-to-update-data-source-credentials-value-cannot-be-null-parameter-name/13270/8 "2019-03-11T09:52:08Z")

</div>

Hi Isaac,

Thank you for your reply.

**"**** The connection made successful and i got data from Hubspot".** It means i could have access the hubspot data in power bi desktop but when i come to set schedule refresh in power bi online service, I am getting the error. It always fails.

**“Are you able to trigger a manual refresh by clicking Refresh Now or does that fail too?”**. Yes Manual refresh is working fine in power bi desktop. But the problem only in schedule automatic refresh.

**“Can you confirm that your integration actively [refreshes its access tokens](https://developers.hubspot.com/docs/methods/oauth2/refresh-access-token)with your refresh token?”**

Yes since i am using custom hubspot connector it actively refreshes its access token with my access token. The problem is when redirected uri from hubspot outh2, the error happens.

Thanks

Vinoth S

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [March 14, 2019, 2:24pm UTC](https://community.hubspot.com/t/failed-to-update-data-source-credentials-value-cannot-be-null-parameter-name/13270/9 "2019-03-14T14:24:34Z")

</div>

Thanks for claifying, @vinoths. To be honest, I don’t think I’ll be able to help you much further, since I am not familiar with Power BI’s limitations regarding scheduled automatic refreshing.

I really appreciate you jumping in, @johnelmer. To clarify, are you saying it’s not possible to “directly” connect Power BI’s web service to HubSpot through a HubSpot OAuth app? Vinoth has confirmed that manual refreshes work through this setup, but it sounds like there may be additional hurtles for the automatic refreshing? Would you be able to point Vinoth in the right direction here? Thanks for your time.

---

<div class="post-metadata">

**Author:** ![SprinkleData](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sprinkledata/32/9140_2.png) [@SprinkleData](https://community.hubspot.com/u/SprinkleData)\
**Post date:** [January 23, 2020, 5:10am UTC](https://community.hubspot.com/t/failed-to-update-data-source-credentials-value-cannot-be-null-parameter-name/13270/10 "2020-01-23T05:10:45Z")

</div>

Hi @vinoths

The ingestion rate from the data source and refresh rate at Power BI needs to be the same in ordre to generate reports at periodic intervals. Also, its not easy to directly ingest data from hubspot or any other data source into Power BI directly. Therefore, I recommend you to have a look at [Sprinkle](https://www.sprinkledata.com/), which can easily integrate with both Hubspot and Power BI. Furthermore, you can set reprts to realtime refresh rate as well with Sprinkle.

Regards

Sam
