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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Sql Statement to filte...
Power Automate
Unanswered

Sql Statement to filter Excel Table with dynamic data

(0) ShareShare
ReportReport
Posted on by 214

I have 2 lists that will be changing every day. 

 

List A are Sales requests from clients (From Legacy System) 

 

List B is our CRM System Data Dump (excel b.c. cheap)

 

I am Creating List C, D, E, F, and G. Using the Sales Requests and Legacy system information.

 

We are using PAD because everything needs to stay on network.

 

They only key that links both lists is the account # field. 

 

Originally my flow was using PAD if actions as shown below to see if 

 

IF Excel List A Current Item [Account Number] = List B Current Item  [Account Number] 

Then do X,Y,andZ

 

This was taking forever to run, so, I after some research I am thinking a about pulling in the big excel table with 33k rows 

Via

1.) Open SQL connection to an excel file.

2.) Execute SQL Statement to filter for rows the Account numbers in List A (which is always smaller)?

3. Use for each to loop through each table as I had it before...???

 

I am racking my brain attempting to create a filter for the account numbers via the SQL statement, it would have to be a variable since its changing. What are your guys thoughts? 

 

Any issues with #3?

 

PAD excel if.JPGexcel if flow taking foreverexcel if flow taking forever

 

 

 

  • takolota1 Profile Picture
    4,980 Moderator on at

    @mcnemare1 

     

    Are you trying to update the Excel with values or calculated/transformed values from SQL?

     

    What is the reason for needing to stay on network? Some kind of security or something that would prevent the use of cloud flows?

  • mcnemare1 Profile Picture
    214 on at

    @takolota 

     

    Sorry for the belated response. 

     

    It has determined that since CRM report holds customer sensitive information, that any flows created should be in-network and cloud flows avoided.  

     

    Correct I am trying to filter excel with calculated values from SQL statement.

     

    Since List A 'Sales Requests' (excel file) is always going to be smaller than List B 'CRM' Excel File. 

     

    I'm thinking it would be easier to filter List B 'CRM' by 'List A' Sales Requests. Via SQL first to reduce the initial loops are taking in PAD. thoughts?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 211 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 190

Last 30 days Overall leaderboard