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.

Value lists in calculation fields

Featured Replies

Hi,

I have a calculation that starts by getting an "id_user" value from the table "checkins". Instead of returning this id number, I would like to use it ("id_user") to look up a matching "user_name" in table "users".

Is this possible?

Right now I solve it by the common practice of creating a popup menu where the first value is the id and the second the name. I then only show the second field.

However, I was curious if I could somehow do all of it in the calculation field so I could insert the name via a merge field and not having to use a popup menu.

Thanks,

Phillip

Right now I solve it by the common practice of creating a popup menu where the first value is the id and the second the name. I then only show the second field.

However, I was curious if I could somehow do all of it in the calculation field so I could insert the name via a merge field and not having to use a popup menu.

If you have a relationship with the "users" table, based on matching the selected "id_user" value, you can simply place the "user_name" field from the "users" table on the layout, no calculation field required.

  • Author

Thank you - that makes sense. However, I was trying to avoid adding another TO. 

Perhaps my question is better phrased as:

Is it possible to access a value list in a calculation field?
(Similar to accessing a dictionary in python?)

Is it possible to access a value list in a calculation field?

Yes, it is possible through the ValueListItems() function. However, only the first field can be accessed that way. In order to calculate the value of the corresponding second field, you would have to first define another value list, using values from the "user_name" field and sorted by the "id_user" field, and then use a calculation like this one: http://www.briandunning.com/cf/908

Or you could just place another instance of the local "id_user" field on the layout, format it as pop-up menu and disallow entry.

Yet another option is to have a calculation field = users::user_name and set it to evaluate from the context of a TO that is related to the users table.

Edited by comment

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.