Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Sort order in an ADO (Azure DevOps) query is not being honored when using Azure DevOps Connector: Get query results


Correctly configured/sorted query in ADO is not sorted the same way in Microsoft Flow output when using "Get query results" and "Create HTML table".

Desired outcome:

Create a table with my desired sort using Microsoft Flow based on an existing ADO configured query.


I'm using the Azure DevOps (ADO) connector "Get query results" to create an HTML table in an email. The query in ADO is configured correctly, along with the desired sorting (By Application, By Assembly, By Bug Type). From ADO I can use the "Send query to Outlook" and the table created in email appears with the properly sorted data.


When I use the "Get query results" connector combined with the "Create HTML table" function (I use the custom feature to create my own headers for field values), the table output is NOT sorted in the same order as it is configured in ADO. In fact, the table is simply sorted by ID (WorkItem ID). Which is not a value I even use in my table output.


Am I missing something? Shouldn't the "Get query results" retrieve data in the order the resulting data query (remember, when I'm in ADO and click Send Query to Outlook, the table generated is sorted correctly) or is "Create HTML table" automagically doing something with the data that breaks the desired sorting done by the query?


Thanks for any help and pointers on correcting this.




Community Support
Community Support

Hi @lfbenitez1 ,


Could you please share a screenshot of the configuration of your flow so we would better understand your requirement?


Best regards,



Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Alice, thanks for responding.

Here is my Flow configuration using "Get query results" and "Create HTML table":

Flow Table Config and ADO Query Connect.jpg


Below is what is configured in Azure DevOps for the actual query.


This is the query:

ADO Query.jpg

These are the columns I "show" in ADO:

ADO Columns Selected in Query.jpg

This is the Sorting criteria (which works in ADO) I have defined in ADO:

ADO Sorting in Query.jpg


As I mentioned in the original post and above, the Sorting in ADO works when I run the query in ADO; however, when I grab the query from Flow and then place values in a table and output it in an email, the data is sorted BY "ID"...which is NOT even in my ADO sorting criteria. I WANT my Flow output to be in the same sort order as the original ADO query.

New Member

Helpful resources

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.


Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (8,069)