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.

Featured Replies

Hello, I have a number field where I want the user to be able to enter things like:

  • 42 (only item 42)
  • 12+82 (only items 12 and 82)
  • 1-5 (items 1 through 5)
  • 31,33,35,37 (only items 31,33,35,37)

So I am need of a way for filemaker to deal with the operators '+' '-' and ','

Do you have any advice on how I can separate out the item numbers?

Thanks!

Actually, you only need to "deal" with the "-" operator. The "+" and the comma can be simply substituted with a carriage return to get a list that Filemaker recognizes as a list of values (assuming that's what you want as the result).

Iterating from 1 to 5 and creating the intermediate values requires either a custom recursive function or the While() function or a looping script. Please update your profile to reflect your version and OS so that we know which one of these you can use.

--
Note:
1. A field where a user is allowed to enter "12+82" or "1-5" or "31,33,35,37" should be a Text field.
2. You may face a difficulty if a user enters a value that does not fit one of your 4 formats listed above.

 

Edited by comment

  • Author

Thanks so much for your help, I have updated my profile and started work on the + and , 

If you don't have the Advanced version, you cannot use a custom function (unless someone installs it for you). And if you don't have version 18,  you cannot use the While() function. That leaves us with a looping script. The attached demo shows how it could work.

Note that you can use a script trigger to run the script automatically OnObjectSave.

ProcessEntry.fmp12

  • Author

Thank you so much comment, your file is perfectly clear. The next hurdle I am working on is to allow the user to have both in the same list.

For example: 1-5,19+25,30-33

I believe I should turn the + and , into carriage returns first, then deal with the hyphens with a loop through the list entries somehow

Edited by nsdodgers

6 hours ago, nsdodgers said:

I believe I should turn the + and , into carriage returns first, then deal with the hyphens with a loop through the list entries somehow

I would start by substituting "+" and "," with ¶. Then loop over the resulting values. If the current value contains "-", create the intermediate values and add them to the result. Otherwise add the value to the result.

 

Edited by comment

  • 2 weeks later...
  • Author

It's the reverse of what we worked on in the other post. Going from a list to a range

Edited by nsdodgers

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.