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.

getting a script parameter from a list

Featured Replies

hi all,

i have a script that, among other things, creates a multiline key to filter a portal by date ranges.

on my layout, i have several buttons that trigger a script using a different set of script parameters. for example, if i click the button labeled '1st quarter', the key field will be populated with something like

1|2011

2|2011

3|2011

and the parameters i pass to the script by clicking the button are

"1¶2¶3" & "1st quarter"

i am using the literal at the end to put on a field of the report so i don't forget it. this all works very nice for all quarters, but i also want button for the first and second half of the year, and also the entire year which will both make the key field longer and requires a longer list of script parameters.

the problem is that the script is evaluating the ¶ characters of the script parameters as delimiters. so if the number of months in my report changes, then some month number gets stuffed into the field of my report that should actually display the report period.

how can i tell filemaker that "1¶2¶3" or any other set of months should be treated as one expression?

thanks,

stefan

You could use a different delimiter, e.g.:

"1§2§3¶1st quarter"

then do =

Substitute ( GetValue ( Get (ScriptParameter) ; 1 ) ; "§" ; ¶ )

to get the return-separated list of months.

Alternatively, leave the parameter as is, and use =

LeftValues ( Get (ScriptParameter) ; ValueCount ( Get (ScriptParameter) ) - 1 )

to get the list and =

RightValues ( Get (ScriptParameter) ; 1 )

to get the trailing text. This is assuming there always is trailing text.

  • Author

hey, not just a solution, but a double-pack of them! thanks much - that wil do the trick!

stefan

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.