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.

Don't leave space if the field is empty

Featured Replies

Hello,

 

Can Someone help me i have a merge code lets say i have 3 fields firstname, middlename and last name and i have a substitute field to put this 3 field

 

Substitute ( Self ;
[ "<<firstname>>" ; table::firstname ] ;
[ "<<middlename>>" ; table::middlename ] ;
[ "<<lastname>>" ; table::lastname ] ; 
)
 
and i put this on this substitute field for example 
 
My name is <<firstname>> <<middlename>> <<lastname>>
 
My problem is if the <<middlename>> is empty it leaves a space is there a way to remove the space without actually removing the <<middlename>> on the center?

 

You could either add the spaces conditionally, based on the result of IsEmpty ( middlename ) - or attack the problem globally, using the TrimAll() function.

Simple answer would be FirstName & “ “ & MiddleName & “ “ & LastName assuming all fields are not empty?

 

Most of the time the data in the fields are not always that clean.

 

This would probably work for you

// Trim removes and leading and trailing spaces. Substitute removes the extra spaces if there is no middle name.
 
Trim(
    Substitute(
        Title & " " & First & " " & Middle & " " & Last;
        [ "  "; " " ];
        // Remove 2 spaces
[ "¶"; "" ]
        // Remove extra carriage returns
    )
)
I like List() and Substitute().
 
Let( [

first.name = Substitute ( Self  ; "<<firstname>>" ; table::firstname  ) ;

middle.name = Substitute ( Self  ; "<<middlename>>" ; table::middlename  ) ;

last.name = Substitute ( Self  ; "<<lastname>>" ; table::lastname  ) ;

 

result = Substitute ( List ( first.name ; middle.name ; last.name ) ; "¶" ; " " )

];

result

)

 

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.