I think the variables or activities are not correctly set or linked, since having no results… or maybe screen scraping is not set correctly… as well as dont know how to build the part for writing the results back to csv file
attached xls file (cvs is not allowed to upload)Clients.xlsx (7.7 KB)
After looking over your workflow briefly, I can give you a few ideas.
After searching for the client name, you need to do 2 things:
extract the text that determines if the item is found or not
Inside the If activity, use an Assign activity in both sides.
—if it is found, Assign row(“column”) = url
—else it is not found, Assign row(“column”) = “no match”
“column” is the column name where you would like to add the url or no match to. If the column does not exist, use an “Add Data Column” right after the Read CSV.
So, essentially you are assigning the value in the column of the row that you are searching. This saves it in the data table (dtContacts). Finally, either outside the loop or inside but outside the If condition, place your Write CSV using dtContacts. —if you place the Write CSV outside the loop, it will update the file after everything is done and is faster —if you place the Write CSV inside the loop it will update each row as you go but might be slightly slower.
In case you are a visual learner, here is a quick screenshot of what you can do:
many thanks for the explanation… I’ve followed your steps and now having the issue with “write line” activity - once added column to the csv file for results (there are just two columns in csv - Client and Result).
Any thoughts how to fix that?
Attaching the updated scenario - Test.xaml (25.1 KB)
thanks, now it works… almost there but got stuck in assign activity row(“Result”) = AddressdisplayControl… throwing an error - Exception has been thrown by the target of an invocation
I think the reason your column does not exist when you use “Client” or “Results” is because you are using Read CSV with Clients.csv but your file is Clients.xlsx. You might be reading the wrong file. Additionally, if you read a file that doesn’t include all the columns you want, then simply use the Add Data Column activity to add it in (ie Results, if the Results column is not on the initial file)
It’s up to you, but I recommend using the Column name instead of the column index (0) or (1) just because it allows you to change the order of the columns and not impact your process.
Thanks for your post, ClaytonM… actually, the reason why I’ve uploaded a xls file here is that the csv file is not supported to upload… I’m sure that my WF reads and works with Clients.csv file
Anyway, any advise on how to fix the issue with assign activity (row(“Result”) = AddressdisplayControl - not working)?
Hi. I didn’t see any errors, although the website just does not work well at all on my end, like it takes a minute just to move from element to element which was challenging.
I did find that your approach to pull the url was not working. I found this out by placing a Message Box to output the AddressDisplayControl.ToString variable.
So what you might have to do is instead use the Get Attribute with the html tag, like shown below:
If you have further issues, let me know and provide any screenshots or details if possible.
Just making a quick reply on the error you received. It seems like the Attach Window selector does not align with the “partial” selector of the Get attribute.
You could try using the full selector in the Get attribute as a test. To do this, simply select the body of the webpage from either the “Indicate on screen” option (which will give you the correct selector possibly) or in UiExplorer (which will give you the “full” selector; my previous image was only showing the partial selector.