Jump 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.

Parse and Trim in One Calculation

Featured Replies

I currently have a field that takes the first line from an address field (could be a law firm or an attorney's name):

GetValue ( Customer ; 1 )

(for example, John Smith, Esq.)

I also have a second field which takes the data from the above field and, if that address line is an attorney's name, removes the trailing ", Esq." leaving only the attorney's name:

Case ( Right ( PDF_BillTo ; 6) = ", Esq." ; Left  ( PDF_BillTo; Length ( PDF_BillTo ) - 6) ; PDF_BillTo  )

(for example, John Smith)

Is there a way to consolidate both calculations into one field so it's more efficient?  I can't seem to wrap my head around this and it's driving me nuts.

Thanks,

Kevin

The Let() function is very convenient in situations like this, as it allows you to work step by step, without having to nest your statements until they become an unreadable mess.

Let (
name =  GetValue ( Customer ; 1 ) 
;
Case ( Right ( name ; 6 ) = ", Esq." ; Left  ( name ; Length ( name ) - 6 ) ; name  ) 
)

This does the same thing as:

Case ( Right ( GetValue ( Customer ; 1 )  ; 6 ) = ", Esq." ; Left  ( GetValue ( Customer ; 1 ) ; Length ( GetValue ( Customer ; 1 )  ) - 6 ) ; GetValue ( Customer ; 1 )   )

which is not only less readable, but also less efficient, as it has to evaluate the expression GetValue ( Customer ; 1 ) 4 times.

 

 

Edited by comment

  • Author

Thanks so much.  As you can see, I'm no Filemaker expert and sometimes I hit a wall and need a shove in the right direction.

Thanks again, and have a great day.

Kevin

Create an account or sign in to comment

Important Information

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

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.