How can add a flagging status in excel so that bot will not download the same file 2 times?
If there is any unique name…then first check if that file is present and then do not download it…this can be one strategy…
If more details are provided we can go with any other route if possible
Cheers
Here’s an example workflow to illustrate these steps:
- Use the “Excel Application Scope” activity to open the Excel file.
- Add the “Read Range” activity inside the scope and specify the sheet name and range to read the data into a DataTable variable.
- Identify the file to download using your automation logic.
- Use the “Lookup Range” activity to search for the file name or unique identifier in the Excel sheet. This activity allows you to find the row where the file is located.
- Check if the file is found in the Excel sheet. If it is not found, proceed with downloading the file.
- If the file is found, check the flag status in the corresponding cell. You can use the “Get Row Item” activity to retrieve the flag status value.
- Check the value obtained from the “Get Row Item” activity to determine if the file has been flagged as downloaded before. If the flag status indicates that the file has been downloaded, skip the download process.
- If the file has not been flagged as downloaded, perform the download process.
- Once the file is successfully downloaded, use the “Write Cell” activity to update the flag status in the Excel sheet. Specify the cell corresponding to the file and set the value to indicate that the file has been downloaded.
It is a CSV file bot is reading csv file in this file subject column is there
so i have mentioned that subjects in the array,whichever subject i want to download for example
{"SEBI Order in the matter ",“SAT Order in the matter”,"Interim order ",“In the Matter”}
this are the different subjects i want to download,But bot is downloading same subject 2 times because in that subject some time interim order and in the matter this same words are mentioned so that is the reason it is downloading 2 time’s…How can i stop downloading same pdf multiple time’s?
Hi @Priyesh_Shetty1 - I believe there is no such flag capability in studio. But, to handle this scenario
- Once you download the file, make sure you write the file name in notepad or some excel file
- Before you download another file first you refer to the previously created notepad or excel file, if that file name exists don’t download, else go ahead with the step.
@ushu It is a CSV file bot is reading csv file in this file subject column is there
so i have mentioned that subjects in the array,whichever subject i want to download for example
{"SEBI Order in the matter ",“SAT Order in the matter”,"Interim order ",“In the Matter”}
this are the different subjects i want to download,But bot is downloading same subject 2 times because in that subject some time interim order and in the matter this same words are mentioned so that is the reason it is downloading 2 time’s…How can i stop downloading same pdf multiple time’s?
@Priyesh_Shetty1 - Here, bot is working as expected. if the subject matches with the one in an Array, it is trying to download the pdf file. Since multiple keywords in an array matching with the same subject, it is causing the issue.
I’m not sure how you built a logic (assuming you are looping the array variable), but think of this, once you download the file for a single subject, break the loop, and start from the first keyword again and move to next doc/eamil etc
If this didn’t work, you might be downloading the file to downloads folder, make sure you’re moving this to some temp folder called Processed. Now, assume you’ve downloaded a file, before moving to temp folder, check that file already exists or no. If it exists, delete the downloaded file
@ushu iam deleting all the previous pdf files first, Then the bot is downloading the new PDF files…I have use 2 for loops one for each loop and another is for each row in data table.
CurrentRow(“CSV COLUMN NAME”).ToString.ToUpper.Contains(currentItem.ToString.ToUpper)
In that loop i used if with this mentioned condition.
Try this-
Here’s how you can achieve this:
- Create an Excel spreadsheet or use an existing one to store the file download status.
- Add a new column to the spreadsheet, such as “Download Status” or “Flagged.” This column will be used to track whether a file has been downloaded or not.
- Initially, set the value of the “Download Status” column for all files to a default value, such as “Not Downloaded” or “Pending.”
- When the bot downloads a file, update the corresponding row in the spreadsheet to mark it as “Downloaded” or “Flagged.” You can use activities like “Write Cell” or “Write Range” in UiPath to update the Excel file.
- Before attempting to download a file, the bot should check the “Download Status” column in the spreadsheet. If the status is marked as “Downloaded” or “Flagged,” it means the file has already been downloaded and should be skipped.
- If the file hasn’t been downloaded yet (status is “Not Downloaded” or “Pending”), the bot can proceed with the download process and update the status in the spreadsheet once completed.
Thanks!!