cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Responsive Resident
Responsive Resident

Select is Duplicating Rows within Apply to Each from sql get rows

For some reason my flow is creating duplicate rows from within a select statement (image below).

 

The get rows (sql) isn't duplicated (I checked the  output). It seems to duplicate the number of times the apply to each is running - so if its running 10 times - then there are 11 rows (with the header).

 

Flow.jpg

 

Example: Flow2.jpg

 

Thanks!

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User III
Dual Super User III

The select data operation works on the whole array to select columns from the array.  It shouldn't be included inside an Apply to each that processes every row in the array.  Just move your select outside the Apply to each and you should be fine.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

5 REPLIES 5
Super User II
Super User II

Hello @TesDA 

Could you share the output of the Get Rows SQL Action (Get Main) ?

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
Dual Super User III
Dual Super User III

The select data operation works on the whole array to select columns from the array.  It shouldn't be included inside an Apply to each that processes every row in the array.  Just move your select outside the Apply to each and you should be fine.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Responsive Resident
Responsive Resident

@fchopo 

This is the first and second rows. Let me know if you need more. There are a total of 10 records (0 to 9).

 

Flow3.jpg

Responsive Resident
Responsive Resident

@pstork  - I need to capture only the rows applicable to that specific run, so that I can send an email with only that row's data. Do you know how I would edit the flow to make sure I can attach just that subset (if that makes sense). Do I do another get rows on the same table?

Dual Super User III
Dual Super User III

If you aren't already filtering the Get Rows down to the set of Rows you want to report on then you should add a filter array after the get rows and before the Selected (Data Operation).  Don't confuse the Select you are using with a SQL select statement.  They aren't the same thing.  If you are looking for a SQL Select then you want the Execute a SQL Query V2 action, not the Select action.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (34,210)