Creating full names in data base

If your user provided a first and last name how do you create a ‘custom data event?’ to combine them as a field of ‘full name’

Hey @denis1

So I am assuming you already have data stored in your app, with just the ‘first name’ and ‘last name’ fields within your users data type. You can create a workflow that will go through the users and combine the 2 fields into one, creating the full name.

So to start with you’ll need to create a new field in your data type ‘user’ called ‘Full Name’ or something similar, set to a ‘text’ type.
image
(note: I’m not using the in-built ‘user’ data type for this type, but works in the same method)

Here is an example of default data prior to merging the first and last name:

This method doesn’t require an API workflow, however, if you are dealing with hundreds of users then a API workflow would be the best option, running on the data type using the ‘Bulk’ action. But I’ll assume we are talking around 100 users mark.

So next you’ll need to add a button to a admin type page which only you can access, away from public if you are deploying to a live environment e.g. version-live.
If you are still building your app, then just create a button on a page and once the operation is complete you can go ahead and delete the button.
image

Now for the workflow on the button:
image


So define your type of thing, this will probably be the ‘User’ data type. Then search for the list, define the type. I’ve added an extra constraint, not necessary if you haven’t already collected the full names for users.
Then on the new field we’ve created, ‘Full Name’ this will be the ‘User’s First Name’ then hit space on the keyboard after defining the expression and then another dynamic expression ‘User’s Last Name’.

Thats it. Once the workflow is complete, we are left with the ‘Full Name’ field populated:

I also added an alert to the page, so that at the end of the process, it will show to notify me. This is an extra workflow for peace of mind.

image

If you don’t already have the data, you can simply use the similar method mentioned above. On your signup form, you can store as first name, last name and the full name if preferred. So for instance the sign up form with the ‘first name’ and ‘last name’ inputs:
image

And then the workflow with in the ‘full name’ field, has 2 dynamic expressions, separated by a space:
image

You can do this at any point e.g. add dynamic expressions more than once in most cases e.g. Send Email action workflow, Create a thing and so on…to retrieve field entry data from data types.

3 Likes

One thing to add is that, as mentioned at the end of the post, having the ‘full name’ field on a user isn’t really needed if you’ve already captured the first and last name of that person. You can combine the dynamic expressions in most cases to achieve the full name approach without having the field.

Something else to bear in mind is that, on your app, if you have the ‘full name’ field, you’ll need to make sure that if a user was to change/update their name e.g. married name change - then you’ll need to have your workflow cater to this change, using the method mentioned above.

1 Like

luke2 Thank you for the thorough solution. also the bullets to consider for the design