cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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
v-xida-msft
Community Support
Community Support

Hi @Anonymous ,

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.
Anonymous
Not applicable

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (3,405)