web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Power BI custom connec...
Power Apps
Unanswered

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

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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

 

 

Method.PNG
202.PNG
Error.PNG
Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    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 Power Platform Member Profile Picture
    Microsoft Employee on at

    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. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 638

#2
Haque Profile Picture

Haque 317

#3
WarrenBelz Profile Picture

WarrenBelz 315 Most Valuable Professional

Last 30 days Overall leaderboard