Power Community

Power Community

Dataflow timeouts in Power Apps

Last week one of my clients had an issue with timeouts in their dataflows in Power Apps. It had worked for a while, but then suddenly the dataflow was experiencing timeouts.

Dataflow query timeout issues

Dataflows failing with timeout.

In my case I found that my dataflows would fail in different ways. But Mainly I would get back the following errors.

Error Code: Mashup Exception Data Source Error, Error Details: Couldn't refresh the entity because of an issue with the mashup document MashupException.Error: DataSource.Error: Microsoft SQL:     502 - Web server received an invalid response while acting as a gateway or proxy server.     

502 - Web server received an invalid response while acting as a gateway or proxy server.

There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.

RequestId: TDS;d6eac48c-9c9b-4d3b-bd04-6aa038c4115d;26 Time: 2024-03-08T16:34:16.2315699Z Details: Reason = DataSource.Error;DataSourceKind = CommonDataService;DataSourcePath = siptracker.crm11.dynamics.com;Message = 502 - Web server received an invalid response while acting as a gateway or proxy server.

The important parts of the above errors are:

Error Code: Mashup Exception Data Source Error, Error Details: Couldn’t refresh the entity because of an issue with the mashup document

and

502 – Web server received an invalid response while acting as a gateway or proxy server.

These issue descriptions are use useful as a chocolate teapot..

So what is going on?

Query architecture in dataflows

Well there are all sorts of things that could be wrong.

Frist of all there could be something wrong in the queries in your dataflow. Typically dataflows have multiple queries and each query has multiple steps resulting in a table as output.

Dataflow timeouts in Power Apps Microsoft Power Apps image 44

When you look at the advanced code for a query you will find the following pattern.

let
Source = ...
in
#"Whatever data"

As mentioned this returns a data represented by the #”Whatever data” part.

Now the table of one query can be used as input for other queries.

So what happens if you have a lot of data and many levels of queries? You get complexity!

Fixing timeout issues in dataflows

When I reviewed the data structures there were no key fields defined on some of the tables. I ended up reviewing how each query is using the data returned by the queries higher up in the chain.

Then quite quickly I noticed the missing keys. All you have to do is select the properties in the table preview (in my case surveyid and propertyid) and then find the Mark as key option in the Transform tab. This will create an index on the table generated by the query.

Dataflow timeouts in Power Apps Microsoft Power Apps image 45

Which queries/tables to focus on?

There are a few approaches to this. I would look either at the queries that give you your results (so these are at the end of your query chain) or look at the first ones first as they are to be used by the later queries. Your indexes are most likely needed in the queries earlier on in the chain of queries.

You might even find that those tables are relatively small. However the usage of those tables, by the later queries may be experiencing larger volumes.

This post was originally published on this site

- Advertisement -spot_img

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement - Advertisement

Latest News

5 Benefits of In-App Notifications for Microsoft Dynamics 365 CRM users

For a successful sales process, you need to stay up-to-date with crucial sales information like deal closures, opportunities won,...

More Articles Like This

- Advertisement -spot_img