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.

Looping script to remove last two charecters in a field..but only if those charecters are letters and not numbers.

Featured Replies

Hi everyone,

If it weren't for one condition this would be a pretty easy script for me. But alas, because of the condition I have no idea how to do this or even if it is possible.

I have a text field where ID numbers will have a suffix of sm, md, lg or no suffix at all. ex 123456789sm. 123456789md, 123456789lg, 123456789.

What I want to do is create a new field that will capture the suffix information.

I need to write a script to pull the last two charecters of the ID number and place them in the new field but only if the last two charecters are letters and not numbers.

This is a classic example of where I should have created the DB with two fields and then used a calculation to combine into one ID number but the need to do this developed long after the soltuion was developed and users started adding the suffix on their own. Now I need to go back and fix the mess. I did not anticipate this.

Any help would be greatly appreciated.

Thanks,

Steve

Right (YourField; 2)

or maybe

Filter (YourField; "abcdefghijklmnopqrstuvwxyz)

Using the SetField ( for either of these should do it)

Lee

In your new field a simple Replace Field Contents by Calc =

Filter( Right (OldField; 2) "smdlg")

then in your old Field, Replace Field Contents =

Left(oldField; Length(oldField)-2)

&

Filter( Right(OldField);2) ; "0123456789")

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.