Transform Name to Firstname / Lastname

I have a problem, my source of information only has the full name, what is the best way to capture only the first name and to capture the rest of the name (surname).

For example:

current name variable: Caio Augusto de Oliveira Francoso

Firstname: Caio

Last name: Augusto de Oliveira Francoso

Hi Caio,
I would try to use Split operation to extract necessary information.

To extract firstname it would be pretty easy as you can use space as delimiter and take first item from the array.

With rest it might be a mor tricky as I suspect alnumber of last names can be different for different users. If you are able to defina what is expected maximal number of lastnames you can try First Valid eg. 5 times to check all possible lastnames.

1 Like

Hi @caofrancoso

As @caofrancoso mentioned, you can use split Transform.

We can split with blank space, but the problem is what if user firstName is Caio Augusto not just Caio. How do you know that ?

It would be great if firstName and lastName is separated with comma.

Thanks
Krish

1 Like

It was successful to capture the first name. I would like to concatenate the transforms of “split” + “normalize names”, is it possible?

{
    "name": "Split First Name and normalize - API HR”,
    "type": "normalizeNames",
    "attributes": {
        "input": {
            "type": "split",
            "attributes": {
                "delimiter": " ",
                "index": 0,
                "input": {
                    "type": "accountAttribute",
                    "attributes": {
                            "sourceName": "API HR",
                            "attributeName": "Complete_Name"
                    }
                }
            }
        }
    }
}

Yes you can do that like this.

unfortunately this transform is giving an error when trying to publish

"name": "Split First Name and normalize - API HR”,

Last quot sign is wrong it should be
"name": "Split First Name and normalize - API HR",
this one is correct.

1 Like

thank you very much! It’s perfect now!

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