Jump to content
Server Maintenance This Week. ×

Separator is member of value list?


LaRetta

This topic is 3151 days old. Please don't post here. Open a new topic instead.

Recommended Posts

If one sets up a field to validate as 'member of value list'
AND
If that value list is custom and it includes a dash separator
THEN
... typing a dash in the field will PASS validation.  :blink:

It seems that FileMaker gave a single hyphen a special role as separator but forgot to handle it from validation context.  Please see attached file.  Clear the drop-down on text1 and type a dash in it.  I envision some User wanting to select 3.75 (the line between two values) and can't so they type dash in the field.  It's the only character outside of legitimate values that is accepted.  I went back and checked version 11 and same behavior so this has been here for a long time.

Part of me wants to say that the dash might come in handy - as an 'all' or 'none' entry but taking advantage of unexpected behavior/bugs can be risky.  If used, it should be clearly documented but I wouldn't recommend it.  In all, knowledge is power which is why I'm posting about it just so others are aware of it.  I will report it as a bug as well.

ValueListHyphen.fmp12

Link to comment
Share on other sites

"but forgot to handle it from validation context"

FileMaker forgot many things: also the count of the value list items is wrong !

Maybe we never realized it because the separation between the values is  so seldom used?

  • Like 1
Link to comment
Share on other sites

LOL, nice observation, Daniele!  The dashes also appear when using ValueListItems().  This is uglier than I originally thought.  This means that calculations such as:

ValueCount ( FilterValues ( listOfValues ; searchValue ) ) = ValueCount ( listOfValues )

... to find if all entries have been checked, will break as well if separator has been used.

True why it probably hasn't been noticed before ... I rarely use separator.

Link to comment
Share on other sites

And if you're dealing with checkmarks, don't forget that it is possible to have multiple instances of a value; and as well as values not in the value list. Probably quite unlikely to happen; but it is possible. If you have a value list of 1 and 2, the field could contain the following values yet only show checkmarks 1 and 2 as set:

1

2

2

3.14

2

Link to comment
Share on other sites

Thanks for the reminder on this, Bruce - there are a few gotchas with value lists, for sure!  :-)

The FilterValues() calculation presented above will remove duplicates and invalids from the field within the calculation so, except for hyphen, will not have a problem.

Of course, garbage bogus data in the field prior to value list control attachment will remain and not be seen.  Duplicate values also will remain even if unchecked (they will continue to re-check themselves) until they ALL have been manually removed by unchecking one duplicate at a time.  I imagine a User unchecking one and have it re-check itself on its own and them thinking there is ghost over their shoulder.  I would assume it's up to the developer to ensure the data is clean during migration/import (according to business rules) prior to control attachment.  A simple [CTRL-I] is quick view of the field's index.

If I were using pop-ups or drop-downs (requiring only a single value), I would include validation by calculation of:

ValueCount ( Self ) ≤ 1

... or use auto-enter REPLACE to select only the last value and just make the decision for the User on which one they preferred. ;-)

It surprises me that this has slipped by us all these years.  I KNOW I've used spacers in value lists for clients and I suspect I've counted some of them before.  I'll be going back through all those solutions.

ValueListHyphen.fmp12

Edited by LaRetta
Link to comment
Share on other sites

Well now.  FMI reports this is expected behavior.  If one can't select a dash in a value list, why would we expect it to COUNT as a value?

Well, at least now folks know about it and hopefully can protect from the issue.

Link to comment
Share on other sites

I love it, Daniele!  Thank you for posting there!

The dash is used as a DISPLAY mechanism only.  It should not be counted as a value nor should it be allowed as a selection.  

Ignore that second attachment.  It was added by mistake and now it won't come off and it doesn't work as a download.

ADDED:  I removed my prior sentence - I take it back - it is when displaying the calculation of the results that the dash shows.  That tripped me before on the cDisplayValueList calc. :-)

Edited by LaRetta
Link to comment
Share on other sites

*** REMOVED - I MISSPOKE ***

Tip  To create a separator line between items in a pop-up menu or drop-down list, or produce spaces between radio buttons or checkboxes, type a hyphen on a separate line where you want each separator line or space to appear.

Edited by Raybaudi
  • Like 1
Link to comment
Share on other sites

This topic is 3151 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.