Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

For each loop with get records is ignoring the filter query I have in my trigger condition

(0) ShareShare
ReportReport
Posted on by 12

I am new to power automate but I am trying to use the salesforce connector to pull multiple pieces of data from projects my team is working on each time they make an update in salesforce. I have a filter query in the trigger condition that occurs when a record is modified that filters to only occur when the local sales manager is who I choose.

( EX: Local_Sales_Manager__c eq 'John Smith').

 

I need to pull data from more than one object in salesforce so I am using the Get Records action to do this for the two other object places I need. Using these makes a for each loop when the dynamic content is added into the excel sheet.

 

When I attempt to run the filter becomes ignored when the for each loop/ Get Records is being used. The filter works as intended when no additional filters are called using Get Records. Am I misunderstanding the Get Records or is there a way to make the filter still apply or appl a filter to the Get Records also.

 

Thank you!

  • InternChristian Profile Picture
    12 on at
    Re: For each loop with get records is ignoring the filter query I have in my trigger condition

    Thank you! Just to expand for others looking, I found objects that pulled the same data for Opportunity and for Oracle Quotes. These have different names but can be used as a way to make sure the filter query only filters for the same project.

  • Verified answer
    wskinnermctc Profile Picture
    6,517 Super User 2025 Season 1 on at
    Re: For each loop with get records is ignoring the filter query I have in my trigger condition

    Ok, I have never used the Salesforce connector. But I do think we can take steps to get your Filter Query working. I would do that by checking the outputs of the data and checking the column names. 

     

    So currently this is your flow:

    1. Trigger - When a Record is Modified
      • Filter Query - Local_Sales_Manager__c eq 'PersonName'
    2. Get Records - Opportunities
    3. Get Records - Oracle Quotes

     

    I would add a compose step to the flow after the initial trigger, and put the dynamic content from the trigger (Opportunities) into the compose step.

    So you should have:

    1. Trigger - When a Record is Modified
      • Filter Query - Local_Sales_Manager__c eq 'PersonName'
    2. Compose
      • Put the Opportunities Dynamic Content from the trigger in this compose.
    3. Get Records - Opportunities
    4. Get Records - Oracle Quotes

    Then run the flow.

     

    When you look at the results of the flow you are looking for 2 things.

    First: Look at the result of the Compose. This will show you what the output of that Opportunities looks like. So you will know if it is a string, number, and whatever is being pulled for that data.

     

    Second: Look at the outputs of the two Get Records. You want to see the specific column names as well as the data that is returned. The specific column name should show you how to type the name in the Filter Query of the Get Records.

    So if the output of Get Records: Opportunities shows the column as "cafsl_Opportunity_c": "OP1234" then you can copy and paste the column name cafsl_Opportunity_c and then put that into the Filter Query of Get Records: Opportunities. You also know that the data itself is a string. 

    However, if the output shows "cafsl_Opportunity_c": 1234 then you know the type of data is an integer and you would not use the single quotes ' around your dynamic content in the Filter Query.

     

    Do you think you can try that or something along those lines? We are basically trying to get the Filter Query for the Get Records: Opportunities to work correctly. And to do that we have to run tests to see what the data is supposed to look like.

  • InternChristian Profile Picture
    12 on at
    Re: For each loop with get records is ignoring the filter query I have in my trigger condition

    I have come to realize that each get records needs its own filter query. This is the filter I was talking about that works when I am not pulling any information besides from the oracle quote object 

    InternChristian_0-1689174180123.png

    My goal is to pull the information from opportunity and oracle quote line items for ONLY the particular oracle quote that is being updated. Because currently I think the get records is pulling from all records causing it to either not work or place projects in my excel sheet not from my team. I have been adjusting my actions steps so dont really have anything thats sticking. Here is an example of one of them: 

    InternChristian_1-1689174469154.png

    edit: I have changed filter query to cafsl__Opportunity__c and still not working.

    I think I can create a dynamic filter using data pulled from "When a oracle quote is modified" in later Get records/ record actions but can not figure out how. I appreciate the response.

     

  • wskinnermctc Profile Picture
    6,517 Super User 2025 Season 1 on at
    Re: For each loop with get records is ignoring the filter query I have in my trigger condition

    Can you show a screenshot of your Salesforce actions? I'm trying to see what you used in the individual steps.

     

    Can you explain more about "When I attempt to run the filter becomes ignored when the for each loop/ Get Records is being used."

     

    Are you are saying that a Filter (what filter?) is being ignored when an Apply to Each step is added to the flow?

     

    Can you explain more about "The filter works as intended when no additional filters are called using Get Records."

    I don't understand what filter works as intended when no other filters are called?

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow