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.

Trouble running a script based on value list selection

Featured Replies

Hello,

In my database, there's a drop-down menu where the user can select various options--say, A, B, C, or D. I am trying to write a script that puts an X in a different edit field/checkbox IF the user selects B, C, or D (not A) in the drop-down.

Every time I write the script, it puts an X in the box regardless of what I've chosen (even if it's A). My script is simple:

If [Field name="B" or "C" or "D"]

Set Field [Field name; "X"]

End If

Do I have to do something different when working with value lists? Is there a special function I should be using?

Thank you!

Look into patternCount.

PatternCount( string1; string2)

counts how many times string2 occurs in string1

You probably want

if patternCount( "BCD"; yourField )

Why not make the field an auto-enter calculation

If ( Field name = "A"; "";"X" )

with the Do not replace existing value box unchecked so that when the dropdown field value is selected the X is entered automatically

I forgot to add - add a script trigger OnObjectModify - to the field to run the script

  • Author

Thanks, everyone...I'd like to do what you suggest, efen, but even with the auto-enter calculation I can't get it to put the X in the box at the correct time. I'd like it to put the X in the "subscription" box whenever any item *except* "entry fee" is selected from the "payment description" pop-up menu. I think I'm confused about how the calculation and script interact... I attached the file, in case you have a minute to look at it. Thank you!!!

contest.fp7.zip

Does the attached do what you want?

contest1.zip

  • Author

Yes, thank you!

Clearly I need to read more about FMP functions and practice my script-writing.

Thanks for taking the time!

Edited by Guest

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.