2017

Jun

13

Av Robert

Have you ever wanted to sort the values of a value list by a third field, or been annoyed that value lists don’t handle non-indexed data? Maybe you sometimes wished it was possible to group data or to have the value list filter when you type characters, instead of jumping? I have!


I have been thinking about a solution to replace the native value lists with a custom and more flexible way. With FileMaker 16’s new Card Window it is now possible! This is a fairly bold idea, I know, but i think I’ve come pretty far.
I presented my technique for the first time at .fmp[x]Berlin 2017 and as I had hoped, the participants and I had an interesting discussion and came up with new features and ideas. Thank you guys for your collaboration!

FlexibleValueListsGrouped

How does it work?

When you enter the field, the script fires with name of the source layout as a parameter. It switches to that layout and sets variables from the text objects. Then it calculates the width and position of the field and opens a card window below the field.  In the card window, it processes the data in the source layout and saves it in a variable. The last thing it does is changing to the value list layout and sort it. While the card window is open, it listens for keyboard input and filters the list by the characters that the user types.

There is instructions in the database how to use it.

FlexibleValueListsImages

 

You can implement the Flexible Value List in your own solutions with help of the sample file (see below).

Features:

  • Sort values by a third field
  • Group values by a third field
  • Handles unindexed data
  • Just as quick as native value list to implement
  • Easy to implement in a completely new database
  • Easy to filter list using FileMaker search logic
  • Works like a native value list with keyboard input
  • Change design quickly in one place
  • Easy to change settings with variables in layout
  • Use native value list as data
  • Show images in the list

The features I want to implement in the future:

  • Show limited value list based on ID
  • Show checkbox instead of highlighting the value with colour
  • Five recent values on top. Last chosen values saved in a table (thank you Peter Kraaijeveld)
  • Five recent values on top per session/user
  • Specify list height in rows
  • Animated display in Go
  • Handle different languages
  • Hide ID field and only show list value (thank you Paul Jansen, APJ Ltd for the idea)
  • Option to enable more info with tooltip when hovering a value in the list
  • Option to cache the list to handle many values
  • Make it possible to add new data to the list while opened
  • More..? Any ideas? Make your own changes!

Limitations:

  • This solution will not work in WebDirect because it does not support cards. I hope that FileMaker will change that in the future.
  • It’s not possible to dismiss the list by clicking outside of window

Ongoing project

My idea is to update this post with new versions so it could be the source of the latest code. I would be very happy if you could send me an e-mail if you add features to it!

A video how it might look like when changing from a native value list to a flexible:

Download database here: Flexible Value Lists.fmp12

Kommentarer

2017-06-13 Robert

Suggestion - add a Go to Field () script step to the Close script - after Close Window

2017-06-16 Daniel Shanahan

Very cool. Thanks for sharing the technique.

2017-06-23 Tom Fitch

Very nice idea. It does feel like it needs a way to cancel without forcing me to choose a value. E.g., maybe add a top navigation part to the card layout and add a cancel button there, or use the built-in card/close option.

2017-06-29 Robert Samnegård

You're welcome! Please let me know if you make any cool improvements of it!

2017-06-29 Robert Samnegård

Don't you mean Go to next field to replicate the native value lists behaviour? Or maybe you have another idea in mind?
Thank you for your input!

2017-06-29 Robert Samnegård

Agreed! You're not the first to point that out :-)
The reason it's not there is that I thought it didn't look good and that the native value lists doesn't have it. It is possible to close with escape button but a navigation part with a close button would be good especially because it's not possible to dismiss the card window clicking outside of it.
Thank you for your input!

2017-07-14 Lots of Good FileMaker Stuff - FileMakerProGurus

[…] major ways, with lots more to come. Check out Robert Samnegård's use of the Card feature to build Flexible Value Lists. There is, of course, a free FileMaker example file included at the […]

2017-10-31 Niklas

Gillart!

2018-01-03 Jens Rasmussen

Very nice, Robert!
Observation:
Epic 404 - Article Not Found
- when I try to download the sample file.

2018-01-04 Rolf

Thanks!

Sorry, we moved the site yesterday. The sample file is now available again.

Skriv en kommentar

Din epost-adress stannar hos oss.