cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dmontoya3
Level: Powered On

Power BI custom connector not able to hande 202 response "The data returned in the response is invalid"

I have a Power BI custom connector to refresh datasets and developed my app to get the groups, the datasets and finally post the refresh. The GET methods work correctly but when I POST the refresh, although it works correctly, I get a message saying "CustomAPIName.RefreshGroupDataset failed: The data returned in the response is invalid"


Error.PNG

In the custom connector test I see that I'm receiving a 202 response which means accepted but the response comes with no body info and apparently PowerApps is not handling correctly the response. 

202.PNG

I've tried to ClearCollect and Set a variable to catch the response but no luck. I've tried also importing the response into the custom connector and variations of the header but same result. In terms of functionality, the app works, however is annoying to get that error message, specially for the user. 

Method.PNG

 

 

2 REPLIES 2
Community Support Team
Community Support Team

Re: Power BI custom connector not able to hande 202 response "The data returned in the response is invalid"

Hi @dmontoya3 ,

Could you please share more details about the Response Body you defined in your Custom connector for the "RefreshGroupDataset" action?

 Do you call the "Datasets - Refresh Dataset In Group" Power BI Rest API within your custom connector?

 

If you call the "Datasets - Refresh Dataset In Group" Power BI Rest API within your custom connector, you should not define a Response Body Payload for the corresponding action. For "Datasets - Refresh Dataset In Group" Power BI Rest API, there is no Response boay payload required, please check the following article for more details:

https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/refreshdatasetingroup

 

If you defined a Response Body Payload for the corresponding action in your custom connector, please consider remove the Response Body payload (JSON schema) from your custom connector, then re-publish your custom connector, then re-create a new connection to your custom connector within your app, then try the CustomAPIName.RefreshGroupDataset() function again, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
dmontoya3
Level: Powered On

Re: Power BI custom connector not able to hande 202 response "The data returned in the response is invalid"

Hi, thanks for your reply. I have 3 methods in my custom connector: 

GetGroups - To collect the Workspaces from PowerBI

GetDatasets - To collect the datasets from a given workspace

RefreshGroupDataset - To post a group and a dataset to be refreshed in PowerBI

 

The first two methods work OK and I use them in my app fro the 3rd method. In the 3rd method "RefreshGroupDataset" I just set up a default response with the 202 as the name, no headers and no body. By default it adds a "*key-body-output" field but it is empty.  I tried this with no luck. Afterwards I tried importing from an example, which only gives headers and still didn't work. 

 

I edited this image to show the names in english . 

202 response.png

 

 

If I click on "edit" in the "key-body-output" I have this: 

schema properties.png

 

I have no title nor description. The method works and the dataset is indeed refresh, it is just the response what powerApps is not catching correctly. Hope this information helps. 

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 52 members 4,409 guests
Recent signins:
Please welcome our newest community members: