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 / SQL Get Rows One to Many
Power Automate
Answered

SQL Get Rows One to Many

(0) ShareShare
ReportReport
Posted on by 42

I have two sql tables: 

 

Table A:  Unique A_PK

Table B:  Foreign key A_PK with multiple entries

 

My flow starts with a trigger "When an item is modified" reading Table B returning A_PK.  Then I want to get all rows from Table B where it equals A_PK from trigger.  There could be up to 5 rows for the same A_PK from Table B.  I tried using Sql "Get Rows" where I need the Status field from all rows where A_PK equals A_PK from trigger.   This last part is where I need help with.  

 

Once I get the Statuses from Table B, then I can evaluate and update Table A Status.  That part I can do.  

 

Thanks in advance. 

Categories:
I have the same question (0)
  • Verified answer
    CU-18081211-6 Profile Picture
    9,270 Moderator on at

    Hi @loraDallas ,

     

    Use the following:

    gabibalaban_0-1614787679860.png

    Table Name: Table B

    Filter Query: A_PK eq @{triggerBody()?['A_PK']} (or triggerBody()?['A_PK']) if you use dynamic content - expression )

    Select Query: Status

     

    Hope it helps !

  • loraDallas Profile Picture
    42 on at

    Thanks gabibalaban.  I was using the dynamic expression from the trigger but didn't try adding the eq A_PK manually.    I was afraid it wouldn't work, but it did.  Thanks for your help.  

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 398 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 323 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 183 Most Valuable Professional

Last 30 days Overall leaderboard