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 Automate / Select top n from Azur...
Power Automate
Answered

Select top n from Azure SQL Databasee

(0) ShareShare
ReportReport
Posted on by 200

I have an app which works with an Azure SQL Database.

 

We have a history screen which is intended to list the most recent incidents recorded in the database.

 

I have an expression which sorts the results, latest at top (i.e. descending).

 

I do not know how to limit the number of database records returned, which will certainly be to much for a non-delagable query.

 

I can create a SQL View, but I'd prefer to keep it clean within PowerApps.

 

In other development tools, I'd use a pass-through query.

 

Or I'd use a paged control and let the results be sent in chunks, with most users only needing the first n results.

 

Looking for suggestions on how to approach a solution.

Categories:
I have the same question (0)
  • Verified answer
    v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi @tom_garvin,

     

    Please try to use FirstN function to return the last set of records of a table.

     

    For your scenario, you could take the following function for a reference:

    FirstN(SortByColumns(Filter(Testing2,StartsWith(Title,TextInput1.Text)),"Created",if(SortDescending1,Ascending, Descending)),10)

     

    Please have a try with it and feel free reply if you need more help.

     

    Besides, please post PowerApps related issues on PowerApps forum so that you could get the most qualified answers.

     

     

    Best regards,

    Mabel Mao

  • GabrielStJohn Profile Picture
    Microsoft Employee on at

    Hello, @tom_garvin!

     

    Have you had an opportunity to apply @v-yamao-msft‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!

     

     

    Thank you for being an active member of the Flow Community!

     

    -Gabriel

    Flow Community Manager

  • tom.garvin Profile Picture
    200 on at

    Thank you, Mabel. I got lost on the way to the PowerApps forum, sorry Smiley Indifferent

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 245

#2
David_MA Profile Picture

David_MA 216 Super User 2026 Season 1

#3
Valantis Profile Picture

Valantis 212

Last 30 days Overall leaderboard