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.

Remove last 3 Charecters and Replace with 3 New

Featured Replies

Hi Everyone....Happy holidays...

I can use some help if someone is available.

I need a script that will trim the last 3 letters from a string of text in a specified field and replace them with 3 letters from a target field.

It will always be 3 letters and it will always be the last three letters that need need to be swapped.

Any help would be greatly appreciated.

Thanks,

Steve

If [ Length ( YourField ) > 2 ]

Set Field [ YourField; Replace( YourField; Length ( YourField ) - 3; 3; Target ) ]

End If

Edited by Guest
Fixed misplaced closing parenthesis

  • Author

Hey Mister V....

I tried your suggestion and it is sticking the 3 letters I need immediatly after the first letter in the required field.

Here is the field (ControlName) as entered before running the script:

EUROPE-ITALY-Washington-HS-AZ-rdu

The last three letters [rdu] need to be replaced with the letters "nyc" as in the field (Departure).

Below is the result if I run the script as currently entered :B

EnycPE-ITALY-Washington-HS-AZ-rdu

If[(Length(ControlName)>2)]

Set Field [ControlName;

Replace( ControlName; Length ( ControlName-3 ); 3; DEP_Itin_1)

Have I made a mistake here? The result should look like this:

EUROPE-ITALY-Washington-HS-AZ-nyc

Thanks for your help...It is very much appreciated.

Steve

Sorry try it now. I misplaced the closing paranthesis when typing.

  • Author

Hey V...

Sorry but this won;t work either...FM won;t let me closwe the dialog because of the add ( at the end.

Your Code

Replace( YourField; Length ( YourField ) - 3; 3; Target ) )

My Code

Replace( ControlName; Length ( ControlName- 3 ); 3; DEP_Itin_1))

I really appreciate your help.

Steve

It should be:

Replace ( ControlName ; Length ( ControlName ) - 2 ; 3 ; DEP_Itin_1 )

or, if you like:

Left ( ControlName ; Length ( ControlName ) - 3 ) & DEP_Itin_1

  • Author

Perfect Comment...thank you!

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.