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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to Retrieve Just O...
Power Automate
Unanswered

How to Retrieve Just One Row from an SQL View

(0) ShareShare
ReportReport
Posted on by 84

I'm currently trying to figure out how to fetch only a single row from an SQL view using Power Automate. I'm aware of the "Get row" action, but it seems to be limited to SQL tables and doesn't list views as an option.

 

On the other hand, the "Get Rows" action does include views. However, my challenge arises when I attempt to use the values fetched. Even though I specify that I want only the top row by setting the limit to 1, Power Automate automatically generates an "Apply to each" action.

Is there a way to prevent the creation of the "Apply to each" action when I'm only interested in the first row from the view?

Any advice or workarounds would be greatly appreciated!

 

 

AmirZolf_0-1712588860687.png

 

 

AmirZolf_1-1712588879757.png

 

 

 

AmirZolf_2-1712588922172.png

 

Categories:
I have the same question (0)
  • Verified answer
    ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @AmirZolf 

    If there is only one item returned, the loop really isn't hurting anything.  

    One way to avoid the loop is by using the first() expression.  See my example below.  I am using SharePoint but it shouldn't matter.

    Here are the expressions that I use - I am retrieving the title column

    first(outputs('Get_items')?['body/value'])

    outputs('Compose')['Title']

    image.png

     

    Another way to do this is to reference the first element in the collection [0]

  • Amirhz Profile Picture
    84 on at

    That worked, thanks

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard