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

Delete last text character in field

Featured Replies

  • Newbies

I have been trying to figure out a calculation (for use in a script) that will delete the last character in a text field. I've tried various find/replace with "", and other options, but no luck yet.

Replacing/deleting the last character is probably all I would normally need, but replacing/deleting the last character IF that character is "x" would be safer.

New to this forum. Skills have gotten kind of rusty with FM. Thanks very much for any tips, pointers to other help files, etc.

Ed

Case(

Right ( yourField ; 1 ) = "x" ; Left ( yourField ; Length ( yourField ) - 1 );

yourField

)

  • Author
  • Newbies

Case(

Right ( yourField [color:red]) = "x" ; Left ( yourField ; Length ( yourField ) - 1 ;

yourField

)

Thanks very much!

I tried your suggestion above -- but FM highlighted the first "[color:red])" and said there are too few parameters in this function.

So I changed that part to be consistent with: Right ( text ; numberOfCharacters )

Then the calc read:

Case(

Right ( yourField; 1 ) = "x" ; Left ( yourField ; Length ( yourField ) - 1 [color:red];

yourField

)

But FM highlighted the "[color:red];" after the -1

and said "There are too many parameters in this function."

I've tried a few things. Probably getting close to a solution, but no success yet.

Thanks again!

Ed

raybaudi's solution reads:

[color:green]Case(

Right ( yourField ; 1 ) = "x" ; Left ( yourField ; Length ( yourField ) - 1 );

yourField

)

Your first version read: [color:red]Right ( yourField ) = "x" not [color:green]Right ( yourField ; 1 ) = "x"

Your second reads: [color:red]Left ( yourField ; Length ( yourField ) - 1 ; instead of: [color:green]Left ( yourField ; Length ( yourField ) - 1 ); ...you missed the bracket off!

Just read more carefully or copy and paste it...

It DOES look like a copy/paste. There is also possibility that Danielle corrected it after it was copied. We correct our posts quite often. :wink2:

That is a distinct posibility ... but the error does seem to be right next to "yourField" in both places ... which Edv probably would have changed to fit the calc discussed.

  • Author
  • Newbies

Great! It works! Thanks very much to raybaudi(!) and StuartT and LaRetta.

Unless I copied and pasted things wrong this is what works for me...

[color:blue]Case(

Right ( YourField; 1 ) = "x" ; Left (YourField ; Length ( YourField ) - 1 );

YourField

)

Thanks again... I am overwhelmed by all the help and hope to give back to the forum when I can!

Ed

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.