Hi, i am looking to extract the last word in an array. Sometime it will be the second word and other time the third word.
Clients who have middle names i will need the third word and for clients who have no middle name i will need the second word.
I need to extract the surname from the cell. pleasee see below
i have been able to the first part of the process in matching the first name initial from the cell to the webpage but i have no idea how i can do this with the surname. With the surname i will need to match the surname exactly unlike the first name where we are only matching the initial.
Below is a screen shot of my current workflow for this particular check
From given image I would suggest to split the string with WR. So the fist part would be the name.
Then split based on spaces and read the last part of it to get the surname.
@Saahil_Chauhan that works in getting the first name but with the middle name being inconsistent there will be times it will pick the middle name to match with the webpage therefore thats not a solution i can used.
Is there a way to just get the surname and not have to think about the middle name like last.array for example?
Where do you store the text retrieved from each cell? Are you using a For Each to go through the datatable? If so you can change the “valueFromCell” variable to the one where you stored the cell’s text
What is the string currently being processed when it errored out? I’m thinking it probably does not have the WR which is why it’s erroring out. Can you try checking the value of the Name.IndexOf("WR").ToString via Log Message activity then rerun using the string that errors out?