Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Displaying customized name in a field

Featured Replies

  • Newbies

Hello,

I'm a bit new to FileMaker and I've come to a situation where I have a Name field for entering a person's full name. However, if in case there is a name too long, FM seems to cut it off when viewing that field in browse mode. However once you click inside the Name field you see the whole name.

My main question is, how can I have my database take a full name and perhaps display it in the name field as (first initial of first name and then full last name?). For example take a long name like Richard Blahblahblahman and have it displayed as R. Blahblahblahman.

Thanks for any help!

This can be accomplished with a short tidy calculation.

Create a calculation field to be used for display purposes on your layout. You will not be able to enter data in this field, so if your input field must reside on the same layout as this display field, make sure the display calculation field is locked and covers the top of the input field.

If you want to just display all names in an abbreviated manner simply use this calculation example:

(Assuming your field name is called "fullname")

left(leftwords(fullname,1),1) & ". " & middle(fullname , length(leftwords(fullname,1) + 2), length(fullname))

The above calculation simply grabs the first character of the first word and adds a "." and a space after it. It then displays the remainder of the name field by determining the starting character number of the next word in the fullname field and displays the name starting from that character number through to the last character number.

You can also make it conditional on how it displays the name so that it will only do this for names that are considered too long. For this example I'm using 30 characters as the number to decide if a name needs to be abbreviated. So if a name is longer than 30 characters, it will abbreviate it.

Example:

if( Length(fullname) > 30 ,

left(leftwords(fullname,1),1) & ". " & middle(fullname , length(leftwords(fullname,1) + 2), length(fullname))

, fullname)

Hope this helps!

  • Author
  • Newbies

Thanks for the help Brian! Yes, I just began learning the basics of design and layouts. Now I need to dive into calculations and all. Thanks for the input and it's exactly what I needed to continue in my database.

-ndz

Here's a new way to look at this, as I have learned over time. Think the other way - collect each part of the name separately: LastName, FirstName, MiddleName, Suffix (Jr, III, etc.). Then you can use calculation fields to display the name any way you want to AND it allows sorting by any one of the name elements (sort by LastName or sort by FirstName).

Any of my databases now are separated out in this fashion. I had too many times where trying to parse out names from a single field bit me in the butt. What about someone that has only a single legal name (like "Cher"). What about multi-word last names (de Jesus or Vande Kamp or Vander Wahl) or hyphenated last names or first names (Julie Anna or Rose Mary).

Here would be the calculation to show the Last Name, First Name and Middle Initial:

Case(not IsEmpty(NameLast), NameLast) & Case(not IsEmpty(NameFirst), ", " & NameFirst ) & Case(not IsEmpty(NameMI), " " & NameMI )

First Name, Middle Initial, Last Name:

Case(not IsEmpty(NameFirst), NameFirst & " ") & Case(not IsEmpty(NameMI), left(NameMI,1) & ". " ) & Case(not IsEmpty(NameLast), NameLast)

In other words, it's easier to concatenate from separate fields with some conditional calcuations that it is to parse out using BrianC's solution.

Your first calc produces a few odd results, depending on which field(s) are empty. This one seems to be more reliable.

NameLast & Case( not (IsEmpty(NameLast) or IsEmpty(NameFirst & NameMI)), ", " ) & NameFirst & Case( not (IsEmpty(NameFirst) or IsEmpty(NameMI)), " " ) & NameMI

For your second one, move the space after the period to the last Case.

... & Case( not IsEmpty(NameLast), " " & NameLast )

so that there is no space after the middle initial when NameLast is empty. Of course, this is nitpicking since you should not have a middle name without a last name, or so one would hope.

Yeah - I like yours better, Queue.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.