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.

Calculating a value list index based on selection

Featured Replies

Hello FM Community. I am a decent FM developer, yet I have come across a problem. I believe the answer is slapping me in the face but I can't feel it. OK, I hope this isn't something ridiculous, but here goes:

1.) I have a radio-button list called "status"

2.) The user selects a button "made first phone call"

I want to have a second calculation field called "next step" in which the next item in the value list is selected.

I can't seem to find any function that lets you directly reference a specific index in the value list, like " myValueList[5] " would return the fifth item in the value list, or " myValueList[#next] " or something like that.

Please help!

Hi,

There may be another "cleaner" method, but this one works.

The sample is based on a "one word" value-list and a calculation. Scripting it would IMO be even more straightforward, when you get the principles.

Now, you'd surely need to "pay" a visit to this thread , from which the solution here provided is largely inspired, that also could help handling multiple words value-lists.

NextRadioButton.fp5.zip

  • Author

Thanks UGO. Your assistance was very helpful. What I ended up doing isn't very efficient, but there were 10 items in my list with multiple words in each item, so your method seemed confusing to me. However, I completely glazed over the "choose" function for some reason. So, what I did was create an "index" value list from 0 to 9 and used that for my data entry, then hard-coded the other list items into the script using "Choose()" to return the correct list item. I know it sounds sloppy but it made more sense to me.

Thanks for your putting me on the right track!

Hi,

This tip was made really quickly. I jumped on Ray's Middlewords technique, but you could have better results with the Middle() function, which wouldn't require any index. Just target the next Carriage Return, and extract the string.

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.