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.

Getting the value of a field whose name appears in a field

Featured Replies

I'm guessing the answer is fairly obvious (or else I'm making this too complicated), but ...

I have two fields, field1 and field2. I have another field, whichField, which uses a value list containing field1 and field2, so that the user can select a field on which to perform an operation in a script.

In the script, I want to get the value of the field1 or field2 (in the active record) being referred to by whichField.

If whichField is set to field1, and field1 (in the active record) contains "cat", I want to get that value.

I've looked in the functions, but am either overlooking something, or am thinking about this the wrong way.

I am not sure what you're hoping to accomplish by this arrangement, but look (carefully) at the GetField() function.

  • Author

That is it!

I'm building an interface where the user enters the number of characters desired to be padded out with leading zeros, and then chooses which field to be padded, using a field "whichField", which has a pop up value list of the possible fields to choose from. E.g., if the desired padding # is 8, and the field to be padded is "345678", I want the result to be "00345678"). Thank you.

Update (pardon for changing the subject).

When I run an 'Exit Loop If' using:

Length ( $leadingZerosText ) + Length ( GetField ( AddLeadingZeros::WhichField ) ) = Length ( AddLeadingZeros::DesiredStringLengthOfField )

... and the results get to (after some looping) '2+6=8', the loop doesn't exit. Even if I change to ≠. If I run "2+6=8" it exits.

Ken

Edited by Guest

I don't think I can answer that without seeing the entire picture.

BTW, you do not need a script to pad a field (as it seems you are doing). A simple calculation like =

Right ( "000000000000" & text ; targetLength )

should be quite sufficient.

You can also use =

Substitute ( 10^n -1 ; "9" ; "0" )

to generate a string of zeros of arbitrary length (up to 404).

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.