Thank you for your post and thank you for sharing the photo. Unfortunately the important part is actually the Expression itself.
So can you please do the following.
In Design mode
1. Please list the expressions you have in the left, middle and right side of the condition (middle isn't an expression I know but show what is there)
In run mode
2. Go back to your flow run that didn't do what you wanted
3. Open the Condition and look at the inputs and check. What we need to see is
This way I can verify what you selected and help you identify the issue.
Now let's talk about your flow.
Step 1: When a file is created, this is fine
However, you should not do a List rows.
You Said
For example, if an Excel file name in the OneDrive folder contains "AA", then move the file to "sharepoint/AA". If it contains "BB", then move it to "sharepoint/BB", and so on.
So, there is no reason to do List rows as that is the data inside the Excel and will not be used to determine if the file should be moved.
Step 2 let's talk about it
Now, Question, how many possible Checks do you have? You said AA and BB, but we have to come up with a plan for identifying how many matches do you have.
File Name contains A,B,C,D,E,F etc etc because we have to solve it as if its a list.
So here is what I would like to Suggest.
I would create a SharePoint List. Let's pretend it's called File Name Mapping
Let's pretend you have the following
AA sharepoints/AA
BB sharepoints/BB
CC sharepoints/CC
DD sharepoints/DD
EE sharepoints/EE
HH sharepoints/HH
I would create a SharePoint List and add these columns
Mapping String SharePoint Folder
AA sharepoints/AA
And so on. All the above would be there.
So your Step 2 would look like this
Get Items (from the SharePoint list we called "File Name Mapping")
Loop through the records
--add a Condition inside the loop
------Left Side Dynamic File Name property from Trigger in the middle select Contains right side put item?['Mapping String']
---------In the Yes side, we know that the string WAS inside the filename so we can move it using the Move Item action
---------In the NO side do nothing
This would allow you to create a dynamic way of adding more Mapping strings
NOTE: I didn't add any steps to Create the subfolder in SharePoint as I expect it to be there.
But this will do what you asked in a Dynamic way. Meaning you can add any new mappings at any time and they will just automatically work without any redeloying