You could take a try with the Aggregation transformation under SQL Get Rows action, then expand the query with related tables:
Follow the article above for the parameters.
There is a workaround for Apply to each, we could take use of variables, within a Do until, to work with two Get rows action.
For the four, I am not sure if it would work.
I will make some tests on this, there might be some time delay before I could share any results.
I havnt tested this but now im more familiar you should be able to do this:
get rows from 1st table, top count 1.
use compose and get the first ID.
now do the for each on the next table using the compose value as the filter on ID.
This is what i havent tested but it should work some how i think:
Use concat to put the IDs from the for each in a comma seperated string
in the next get rows query - ID in Or( Dynamic content string of comma seperated values ) - youll have to play about with the format, it may be when you create the string have the seperator as: ' or ' so that it formats like '1' or '2' or '3'
when i get a chance ill have a play.
Flow can also read a view instead of a table. To create a view you need access to the database with SQL Management Studio (free to download from MS). with a few joins you can create the view you need.
Look out for new contribution recognition badges coming SOON!
Join us for the first ever Power Platform Online Conference!
We've updated and improved the layout and uploading format of the Power Automate Cookbook!
Fill out a quick form to claim your user group badge now!
Learn how to build the business apps that you need.
Find out where you can attend!
Watch & learn from the Power Automate Community Video Gallery!