Loop throw CSV file and download in website

Our requirement is to download the file from each key column and if it is more than one file in key then download only “English Version” file . Below the screenshot from website and csv output of screen scrap.

Can you help me with below requirement?

*How to loop throw the csv file to click the download button

*Download only English version if it is more than one file in key

Do you suggest any other method instead of using table extraction?

Note: Colum F in csv has the language of file.

Here is the Table extraction output of above table from website

1 Like

@Sathish_Kumar_S

You can do that before that you have to check the selector of the save button, there you might see the row number is changing, If that is so, then that is a stable selector

To loop declare a Int32 variable and put a do while activity now you have to take the csv rows count

In Do while condition you have to say that Int32Variable is not equal to the CSV rows. and inside the loop click your activity

Hope this may help you

Thanks,
Srini

Yes, the selector for the download button is based on the rows on the table

Tablerow 2 is download button selector the first file

Can you help me to achieve below requirement (XAML file would be a better)

How do I find the table row for each download button (if two versions of file for key column then download only “eng” version)

Attached the table extracted file for your reference
ExportData.xlsx (10.1 KB)

HI @Sathish_Kumar_S ,
Thanks for reaching out to UiPath forum.
You can follow these steps to make sure the task is completed.

  • Use the Data Scraping Wizard to extract the data from the website into a datatable.
  • Add a For Each Row activity and set the Input property to the datatable.
  • Within the For Each Row activity, use an Assign activity to extract the key column value for each row:keyColumnValue = row(“keyColumnName”).ToString()
  • Use UiPath’s Click activity to click the download button.
  • Use an If activity to check if there is more than one file for the key:If datatable.Select(“keyColumnName='” & keyColumnValue & “'”).Count > 1
  • Within the If activity, use another If activity to check if the language column value is “English”:If row(“languageColumnName”).ToString() = “English”
  • Within the nested If activity, use the Click activity to download the file.

Hope this is helpful, and please mark it as a solution if you find it useful. :writing_hand:

Regards,
@pratik.maskar

@Sathish_Kumar_S

Use For Each row activity and in Properties declare a variable in the Index
Now pass that variable to the selector

Now Inside For Each row activity you can check using IF condition as
If CurrentRow(“Column-4 Alt Text”) <> “de”
In Then place Click activity
Else Empty

Hope this may help you

Thanks,
Srini

We have to check for “eng” file only if more than one file

if only one file for the key then we don’t need to check for english, just download the any file

can you check if the rows are any linked to key , like checking child elements of the row where key is present
you can check this in visual tree in ui explorer
if it linked better use for each ui element for rows and later get child elements of the that particular key row and check for count of elements with attachments
if greater than give the element with attribute “en” for click activity as input
Hope this helps