Looping through excel as variable to perform web task

Hi,

Anyone can help me what should i do with my case. im a newbie with no knowledge about UIPATH but i am looking forward to learning this tool.

My case is
I have an excel file that will contain the configurations for my robot,
2 columns for “Target folder” and then the other is “Folder to download”
the case will be:

  1. Target folder will be dynamic so when i land in microsoft teams (browser) it will look for that folder and then click on it.
  2. Once Clicked, It will look for the 2nd column from the excel to get the Folder to be downloaded “Folder to download”.
    Then proceed to next row to perform the same task.

Hi @Jonathan_J

Here is the steps to achieve your scenario.

Step 1. Use ‘Read Range’ activity to read excel file and store the result in a DataTable (ex:ConfigurationDT)
Step 2: Use ‘For Each Row’ activity to loop through each row in the DataTable(ex:ConfigurationDT)
Step 3: Create couple of variables to store ‘Target Folder’ (Ex:TargetFolder) and ‘Folder to Download’. (Ex:FolderToDownload) value. Variable type should be string.
Step 4. Inside the loop assign value of respective Table Row to variables as in the inline screenshot.
Step 5: Perform the actions on MS teams based the variable values.
Step 6. This process will continue till the last item/row in the DataTable .


Hope this will help you. Thank you.

1 Like

Hi Sir, I appreciate this will try it now.

Thank you very much!

1 Like

@Jonathan_J Please let me know if you have any other doubts on this.

Hi Sir, May i ask what did you write inside the Multiple Assign?

@Jonathan_J

In Multiple Assign you can declare your variable and write as row(“ColumnName”).ToString

Hope this may help you

Thanks

1 Like

Thank you! im trying to write it now

row(“TheColumnNameYouWantToUse”).ToString.Trim

In your case,

row(“TargetFolder”).ToString.Trim
row(“FolderToDownload”).ToString.Trim

1 Like

Thank you sir! i ran it and i got the message
"If: Column ‘FolderToDownload’ does not belong to table DataTable.

I Also noticed when using For Each Row,
I dont see any radio buttons.

The column name should exactly match with your excel column name.

row(“TargetFolder”).ToString.Trim
row(“FolderToDownload”).ToString.Trim

In the above example, replace the column name (TargetFolder,FolderToDownload) with your actual column name on excel file.

1 Like

Great! i had a mispelled column name.
Now selecting the folders listed to download.
Do i need to use find element or click?
Appreciate your hlep sir!

Click on Folder (UI Element) based on the ‘TargetFolder’ value you received from excel file.

Note: The selector should be dynamic one. I means selector should be framed based on TargetFolder column value.

Same applicable for FolderToDownload as well.

Hi Sir sorry for messaging directly. my questions sounds stupid bewcause i have 0 knowledge. for did you mean sir “Click on Folder” activity? or just “Click”?

Click on the specific folder which you want to open by using ‘Click’ activity.

Sorry Sir im a bit lost, but there cant be specific thing to click because i have to relay on what’s inside the excel.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.