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

Community site session details

Session Id :
Power Automate - Building Flows
Suggested answer

Easier way to get the related rows?

(0) ShareShare
ReportReport
Posted on by 892
I have one main record. I have around 8-20 rows (in different other tables) that have lookups to this table. I need to get them all. I know I can use the List rows action for each table and fetch them by a filter on the lookup-field. But is there another way? As some of them are not related from each table there will have to so many checks...
 
 
I have the same question (0)
  • David_MA Profile Picture
    12,515 Super User 2025 Season 2 on at
    Easier way to get the related rows?
    Please be more specific and show what you mean. For example, are you referring to SQL, Excel, or Dataverse? What type of data is in your lookup-field and is this common between the different tables? Is it a one-to-one or one-to-many relationship?

    Can you provide more details about the relationships between your tables? Could you share more about your current approach with the List rows action? Understanding what you’ve tried so far can help in suggesting alternatives. Are there any performance concerns or limitations you’re facing with your current method? Lastly, what is your end goal with this data extraction? Are you looking to consolidate the data into a single view, report, or another format?"
  • Gyllentid Profile Picture
    892 on at
    Easier way to get the related rows?
    @David MA
     
    Yes, I apologise. I use Dataverse. So I have a table of Recruitments. From other tables I have lookup columns to each Recruitment. Had the lookup columne been on the Recruitment table I would have been able to find the ID.
     
    My current approach is this:
    I use the Length() function to count how many rows of bookings we have with the specific recruitment. Then a condition if it does not equal 0 delete the rows.
     
    I filter the List rows action by the lookup column from the bookings table to the Recruitment table.
     
    Hoping there is a simpler way. 
  • Pavel_NaNoi Profile Picture
    1,072 on at
    Easier way to get the related rows?
    Heya, another guy here, its still a bit un-clear as to what your end-goal is, could you give us a more step-by-step process as to what you want the flow to do?
     
    However at the moment with what you've given I think what you're looking for is to use the Expand query field in the list rows action, here's a video that goes into a bit of depth regarding it:
     
  • Gyllentid Profile Picture
    892 on at
    Easier way to get the related rows?
    @Pavel NaNoi

    Edit: It should not say "Deleted rows" in the picture. Find all the rows that are related and then delete them. I will at the end delete the recruitment row. This flow is a scheduled flow.

    I will try to illustrate it: 
    My goal is to find all rows that have a relationship to the recruitment row and delete them. I don't know how you write the relationship? the Certification row in the picture has a lookup column to the recruitment row which makes them related. I don't know how I can be more specific? :)


  • Suggested answer
    David_MA Profile Picture
    12,515 Super User 2025 Season 2 on at
    Easier way to get the related rows?
    I think it is becoming a bit clearer. When a row is deleted in the Recruitment table, you want to delete related rows in the Certification, Contract and Booking tables? If so, your flow will look like this except you will repeat it for the three tables:
    • The trigger points to the table where you want to initiate the flow, which is when a row is deleted.
    • Then you list the rows with a filter based on the common field from the table you want to delete related items:
    • The condition checks to determine if any rows were found matching the filter query. You would use the length expression to determine how many rows are returned. The expression is formatted as such: length(outputs('List_rows')?['body/value']).
    • Then finally, you add an apply to each based on the values returned from the list rows action and delete the row based on its ID:

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 614 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 401 Moderator

#3
chiaraalina Profile Picture

chiaraalina 282

Last 30 days Overall leaderboard