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 / Multiple Data Row Colu...
Power Automate
Unanswered

Multiple Data Row Column issue when compairing two columns PAD

(1) ShareShare
ReportReport
Posted on by 6
I am completely lost on how to move forward from here. I have a flow that when using a ElseIf statement 
 
First operand: %Contains(NSTrace_CurrentLoad['Column7'], NSTrace_CurrentLoad['Column6']) AND Contains(NSTrace_CurrentLoad['Column8'], 'ARRI') OR Contains(NSTrace_CurrentLoad['Column8'], 'PLRM') OR Contains(NSTrace_CurrentLoad['Column8'], 'ARIL') OR Contains(NSTrace_CurrentLoad['Column8'], 'PACT')%
Operator: Equal to (=)
Second operand: True
This is the first data row that the ElseIf is looking at                                                                              Column 6                Column 7                                  Column 8
13876734 |EMHU 200632 | |11/24/2024 04:15 PM |SHREVEPORT |AUSTELL |CHATTANOOGA                  |ARIL |                         |
 
The flow will continue as if 7 contains 6 when after confirming that Column 7 is the word Chattanooga and Column 7 is the work Austell using a message box to test and see that the columns are indeed showing those words as the column variable. 
 
The reason I need the above ElseIf is for the below second Data Row when it occurs 
                                                                             Column 4                                                                    Column 6                Column 7                                  Column 8
13869022| EMHU654479|    |11/24/2024 12:51 AM |CHICAGO |AUSTELL |AUSTELL                        |ARRI |                         |
 
Basically the first ElseIf statement above is for the second data row when running the flow and the first data row information should be using the following ElseIf Statement
 
First operand: %NotContains(NSTrace_CurrentLoad['Column7'], NSTrace_CurrentLoad['Column6']) AND NOT (IsBlank(NSTrace_CurrentLoad['Column4'])) AND Contains(NSTrace_CurrentLoad['Column8'], 'ARRI') OR Contains(NSTrace_CurrentLoad['Column8'], 'ICHR') OR Contains(NSTrace_CurrentLoad['Column8'], 'ARIL') OR Contains(NSTrace_CurrentLoad['Column8'], 'RAMP') OR Contains(NSTrace_CurrentLoad['Column8'], 'LDFC') OR Contains(NSTrace_CurrentLoad['Column8'], 'PURM') OR Contains(NSTrace_CurrentLoad['Column8'], 'ULCH') OR Contains(NSTrace_CurrentLoad['Column8'], 'ICHA') OR Contains(NSTrace_CurrentLoad['Column8'], 'LCHG')%
Operator: Equal to (=)
Second operand: True
 
Now the setup of the ElseIf's will work if I manually go in and change column 8 to a set of 4 letters that is in the second ElseIf statement and not in the first ElseIf but I would rather not have to do that everyday for this flow to work. I know there has to be something I am missing to make them work without having to manually make the change to Column 8 once I have my data each day. Thanks in advance.
I have the same question (0)
  • Suggested answer
    eetuRobo Profile Picture
    4,204 Super User 2025 Season 2 on at
    So I am not completely sure I get your question so if I went to wrong direction please clarify. If you can clarify simply what you are trying to do and what is the problem.

    Your first condition logic:
    If Column 7 contains value that is in Column 6 AND Column 8 has "ARRI". 
    So first rows Column7: CHATTANOOGA and Column6: AUSTELL and Column8 has "ARIL. So neither of those conditions are true. But then your condition checks if Column8 contains "PLRM", "ARIL" or "PACT". So since Colum8 has "ARIL" the condition will be true. The AND only affects the Column7 containing column6 and Column8 having ARRI
     


     
    So the condition is not thinking Column7 contains Column6. That will be false but your Column8 Contains 'ARIL' OR statement is true. So the whole condition is then true.

    If I understand correctly you actually want always the Column7 to contain column6 and then check if it has one of these: "ARRI", "PLRM", "ARIL", "PACT". If so you need to add he first contains + AND before all the other OR contains (not just the first one that checks "ARRI".

    Like so:
    %Contains(NSTrace_CurrentLoad['Column7'], NSTrace_CurrentLoad['Column6']) AND Contains(NSTrace_CurrentLoad['Column8'], 'ARRI') OR Contains(NSTrace_CurrentLoad['Column7'], NSTrace_CurrentLoad['Column6']) AND Contains(NSTrace_CurrentLoad['Column8'], 'PLRM') OR Contains(NSTrace_CurrentLoad['Column7'], NSTrace_CurrentLoad['Column6']) AND Contains(NSTrace_CurrentLoad['Column8'], 'ARIL') OR Contains(NSTrace_CurrentLoad['Column7'], NSTrace_CurrentLoad['Column6']) AND Contains(NSTrace_CurrentLoad['Column8'], 'PACT')%
     

    Since that starts to be very complex and not very readable condition I would break it into multiple. That’s much more simple to examine and troubleshoot.
    Like so:
     


     
  • BS-24110726-0 Profile Picture
    6 on at
     
    You are correct in that I need Column7 to contain Column6 and then Column8 must have one of the following (ARRI or PLRM or ARIL or PACT).
     
    I guess my hope was that there was a way to try and apply the distributive property like (Column7 contains Column6) and (Column8 contains (ARRI or PLRM or ARIL or PACT)) if that makes sense. 
     
    I will give your suggestion a try I know it is messy but I took a flow from 167 lines down to 50ish and would like to keep it down so I can remove the redundant If's for when changes occur it is much easier to adjust maybe 4 or 5 spots vs the 20 plus I was having to make changes when the website I am manipulating with this information has a change on the page and then I have to fix the flow to match what the change was.
     
    Stinks I was really hoping that I could use the
    Contains(NSTrace_CurrentLoad['Column7'], NSTrace_CurrentLoad['Column6']) AND Contains(NSTrace_CurrentLoad['Column8'], 'ARRI') OR Contains(NSTrace_CurrentLoad['Column8'], 'PLRM') OR Contains(NSTrace_CurrentLoad['Column8'], 'ARIL') OR Contains(NSTrace_CurrentLoad['Column8'], 'PACT')
    and not have to have the Column7 contains Column6 with every OR case.
     
    So long as it works I will mark your solution as the one that answered the question thank you.
  • Suggested answer
    eetuRobo Profile Picture
    4,204 Super User 2025 Season 2 on at
    Maybe this is actually better way than what I initially suggested. Try to wrap the OR  statements in side the AND parenthesis: 
    %Contains(NSTrace_CurrentLoad['Column7'], NSTrace_CurrentLoad['Column6']) AND (Contains(NSTrace_CurrentLoad['Column8'], 'ARRI') OR Contains(NSTrace_CurrentLoad['Column8'], 'PLRM') OR Contains(NSTrace_CurrentLoad['Column8'], 'ARIL') OR Contains(NSTrace_CurrentLoad['Column8'], 'PACT'))%


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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard