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 / Exclude values stored ...
Power Automate
Unanswered

Exclude values stored in data table from SQL query

(2) ShareShare
ReportReport
Posted on by 17
I have a flow that first reads a CSV file and stores the values in a data table variable. Next, the flow opens a SQL connection and executes a SQL statement. What I'm trying to accomplish is excluding the data table's values from the SQL query results. For sake of example only (I know the syntax is wrong), I want whatever the equivalent is to: "SELECT * FROM members WHERE member_id not in (SELECT member_id from %CSVDataTable%)". In this example, %CSVDataTable% is the variable that was created when reading the CSV file and the rest of SQL statement is what I would execute against the SQL connection. Thoughts?
 
Thanks!
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,433 Super User 2025 Season 2 on at
    Hi
     
    Can you give more details about what the Field/Fields are you need to match to make sure they don't exist?
     
    You have a couple of options.
     
    1. Depending on the field type you can use in, and depending on whether thats an in (and you have a gallery of ints to compare against), or a string where you have to concat the entire string together to check if its in
     
    2. You could query the data into another gallery and then union them together to take out all the duplicates
     
    Other options are possible but need to understand the uniqe thing, I wasn't sure if member_id is it and is member_id an INT or a STR?
     
     
     
     
     
     
  • schill27 Profile Picture
    17 on at
    The value from the SQL query would be an INT. I'm unsure what the data type is when PAD reads from a CSV. It's very possible these two data types are different from one another.

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard