Check for the correct name

Hi,

I want to do a check, to see IF the top name is the same as the bottom name. Sometimes it can be only a first name, or a last name, or both.
I want the bot to check if the “ärende kontakt” has one or both name as “försäkringstagare” what would be the best way to do that?

Hi @Doktorgud,

Will the bottom name be the basis? In my approach, I would get the two names and store them in String variables.

For the bottom name, I did some string manipulation to rearrange the first name and last name by using below code in an Assign activity:

nameBottom.Split(","c)(1).Trim + " " + nameBottom.Split(","c)(0).Trim

Afterwards, in my If activity, I used the bottom name as the basis and checked if the bottom name contains the top name using the code below:

nameBottom.ToLower.Contains(nameTop.ToLower)

1 Like

Looks like thats working great, ill try some more tomorrow, thanks so much for the help! :smile:

1 Like

but this one, should be okay? but it went false?

Hi @Doktorgud,

It resulted to false because one of the names have “…”. Is there a way you could extract the complete name instead of having the “…”? Maybe it’s in the selectors or the attributes?

Also, I added 2 If statements. 1 that checks if the top name has “,”:

nameTop.Contains(",")

If it does, then reformat/rearrange the name:

nameTop.Split(",“c)(1).Trim + " " + nameTop.Split(”,"c)(0).Trim

And the other If activity for the bottom name.

So i “removed” the “…” but here it went false, is there any way i can do something to make the bot understand that this is okay? because the first and last name are correct? :smiley:

image

If the “first” name is correct its fine to be honest, what can i do to fix that? :smiley:

thank you, means alot to get such good support!

Also, i get this sometimes, i googled it and im not sure why, seems to be diffrent things, but it has been working like 90% and then 10% i get this?