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.

using numbers in Text fields for Text functions

Featured Replies

Help. My scripting is a little rusty.

I have a text field that is only inhabited by 5-digit numbers. I want to write a script that looks at the first 2 characters in the field and fills in another field based on what they are.

I thought I could use the "Left" Text function to return the first 2 characters in the number string. Doesn't seem to work though.

Anyone suggest a method for doing this? I can post the body of the script thus far if you want to see the exact functions or syntax.

Thanks in advance.

Chris

The Left[] function should work. Text includes digits as well as letters.

Just a small thought though... the "numbers" are treated as strings of text, which might create unexpected results:

Value Left[Value, 2]

------------------------------

12345 12

10998 10

76249 76

99 99

2 2

Exactly how is the function not performing the way you expect? By "first two characters" do you mean from the left, or from the right?

[This message has been edited by Vaughan (edited January 15, 2001).]

Firstly I can't see why you should want to use a script for the calculation rather than just using a calculated field. However, assuming you have good reason for doing so, I have tried it using Left(Text Field,2)* 5 as the calculation and it works perfectly regardless whether or not you specify the result as text or a number. Can you email me the script?

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.