How to connect 2 different for each output with if activity

Hello,
We’re trying to create a project that reads a path, get a part of file names and check it in an excel file.
For example there are some files in path like

111_file.xlsx
112_file.xlsx
113_file.xlsx

in excel file we have informatons like

111 mail address 1
112 mail address 2
113 mail address 3

we want to split the file name before ‘_’ and check it is it eequals to a column in excel file data.
if the file name is 111_file and the data in excel file is equal like 111 and 111, then process will send an email to mail address 1 via SMTP.

Our workflow is reading all file names and splitting the numbers from file names via for each activity. Also we are reading the a column in excel file via for each row activity.

When we apply an if activity and set a condition as equal, process is matching the last file 113, 111 and 112 are missing. were expecting to send emails for each file in each row. Probably the mathcing criteria is wrong.
I cannot share the project beacuse it confidential.

Thank you for the support.

Try to debug the workflow and check the values of variable you are comparing and if they are equal then send an email.

We’ve already tried this but probably there is a problem about maintaining the variable structure. We need an example to solve this issue