Correct Sequnce

I have an Excel sheet that contains some photos path and get file info to get the files (photo) path then I have an if activity to check if the path from the Excel same as the one from the get file activity, if it’s the same, will leave if not will copy it

the SEQ I want is

1- BOT to check the file paths on the Excel sheet.
2- get the file’s path
3- compare the path from the Excel to the one from Get file info
note: it more than one so I put all of these in for each activity

image

image

@omar_ismail
pleas correct condition:

PhotosPAath.ToString<>readname OR PhotosPAath.Name.ToUpper.Contains("THUMBS.DB") OR PhotosPAath.Name.ToUpper.Contains("DESKTOP.INI")
image
e

@omar_ismail Tell me now where you are facing issue?

if you could clarify the wrong part to correct it

@omar_ismail
approach is correct. just run it and if you face any issue then show us.

yes i run it that’s why i wrote this issue here

appreciat your support

@omar_ismail what is the error?

Hi @omar_ismail

Step 1: Read the Excel sheet Use the “Excel Application Scope” activity to open the Excel file. Then, use the “Read Range” activity to read the data from the Excel sheet into a DataTable variable (let’s call it dtExcel).

Step 2: For Each Row loop Drag and drop a “For Each Row” activity and set the DataTable to dtExcel.

Step 3: Get File Info Inside the “For Each Row” loop, drag and drop a “Get File Info” activity and provide the file path from the current row. Save the output into a variable (let’s call it fileInfo).

Step 4: Compare the paths After the “Get File Info” activity, add an “IF” activity to compare the paths. Use the following condition:

row(“FilePathColumn”).ToString = fileInfo.ToString

Replace “FilePathColumn” with the column name that contains the file paths in your Excel sheet.

Step 5: Leave or Copy the file If the paths are the same (IF condition is true), drag and drop a “Leave” activity inside the “THEN” section of the IF activity. Otherwise (IF condition is false), use the “Copy File” activity inside the “ELSE” section of the IF activity. Set the source and destination paths accordingly.

Step 6: End of For Each Row loop The “For Each Row” loop should automatically end, and you can continue with other activities after this loop as needed.

Hope it helps!!

thanks a lot for the efforts
if u can clarify number 2 & 3 as i got confused as we have more than one “for each activity” one used for the excel and the other one for each file in folder also for each raw in data table.

let me thank you again as i need this urgently

@omar_ismail

Follow the same steps as mentioned above.
Can you move the read range activity out of the for each and store it in a datatable variable

if you noted I am trying to follow your steps however I get confused that all, as I have a lot of terms so I appreciate your assistance and efforts if you could clarify which one is for each raw, for each file in folder, or for each raw in data table

@omar_ismail
Use CurrentRow instead of row

@omar_ismail

Use Copy file activity in else block

image

till now i didn’t identfy the folder that going to compare or copy from is correct?

@omar_ismail
Set the source Path from where you need to copy to the destination paths accordingly.


done

@omar_ismail
Done,Run and Try

I have another column in the Excel sheet so I need it to read the first column only second I need the BOT to read the path of the photo in the actual file to compare it with the Excel file got my point

@omar_ismail
Yes