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

Removing unnecessary carriage returns and spaces in field data

Featured Replies

I am having problems with sending e-mail through FMP and I think I discovered the problem. Some fields have unnecessary spaces or carriage returns which translates into some ASCII boxes that Outlook doesn't like. As a result, the e-mails don't go out.

Can anyone help me with a way that I can cure this problem without having to check each record one by one? Can I define the field so that these carriage returns or spaces are eliminated also ensuring that it doesn't happen during data entry?

Thanks in advance for any help on this.

You can use the trim function

make a copy of your database first before trying this

Show all the records

click in the field you want

select the records menu

select the replace field contents

click on calculated result

type in:

Trim (fieldname)

click ok

click replace

That should fix it

Or you can make it happen automatically in the field options

select the file menu

define-->database

find the field

highlight the field and click on options

click on calculated value

then put in this:

Trim (fieldname)

that should do it anytime you enter in extra spaces

Dave

I do something similar to this using a Recursive Custom Function as an Auto Enter Calculated Value.

You will need FileMaker Advanced to create a Custom Function and set it up like this:

Function Name:

CF_Remove_Space_Carriage





Parameters:

text





Calculation:

Let( [ Format = Trim ( If ( Right ( text ; 1 ) = "¶" ; Replace ( text ; Length ( text ) ; 1 ; "" ) ; text ) )



];



If ( Right ( Format ; 1 ) = "¶" ; CF_Remove_Space_Carriage ( Format ); Format ) )




And then in your text fields options specify Calculated Value under auto enter and use this custom function calling your text field.



However if you do not have FileMaker Pro Advanced then you will need to set up a calculation field to do roughly the same thing and then use the calculation as your email.




Name:

TextReformat



Calculation:

Let( [ Format = Trim ( If ( Right ( Address ; 1 ) = "¶" ; Replace ( Address ; Length ( Address ) ; 1 ; "" ) ; Address ) )



];



If ( Right ( Format ; 1 ) = "¶" ;TextReformat ; Format ) )

I hope this makes sence and helps.

Orlando

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.