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.

Truncating a text string

Featured Replies

  • Newbies

I created a script in a form that takes values from items that are selected and combines those selections into one field. The idea is that the selections automatically generate a file name that will be used for the name of the art file that we are creating.

The script looks like this: GetValue( Post Pay Category; 1 ) & GetValue( PO Basics; 1 ) & GetValue( PO Getting Started; 1 ), etc, etc, etc.

There are a bunch of 'GetValue' items with the '&' symbol in this script. What is generated is a something like this: PPA12345678B1234567C12345678D.

Now what I'd like to be able to do is to take that long file name and truncate it. If you look at the structure of the file name you see 'PP' plus 'A' plus a string of numbers, plus 'B' plus another string of numbers, and so on. In the end, I want the file name to look something like: PPA1-57-8B124-7C1-8D.

What that does is take any numerically consecutive numbers and replace numbers with a hyphen. For example, 12345, becomes 1-5.

So do you know of any way I can write a script with operators that will take something like 'PPA12345678B1234567C12345678D' and truncate the numbers?

Thanks a bunch!

I have published a custom function that does something very similar with a list of values:

http://www.briandunning.com/cf/734

You might apply a similar logic to your problem.

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.