8 Replies Latest reply on Sep 24, 2012 8:22 AM by DavidJondreau

    Isn't there an easy way to sort a value list?


      I find it hard to believe that after 12 Filemaker versions with a ton of bells and whistles, that sorting a value list (i.e. in reverse alphabetical order) isn't very simple.

      I have a table of event names, and a TO which only selects those events with a specific type... this effectively allows me to create a value list of only those events with that specific type. The value list uses two values, displaying only the second value.

      Now i want to display only the second value in a drop-down list, but i want those second values to be in reverse alphabetical order.

      In the value list TO, i have opted to sort the Value List by the event name in Descending order, but that doesn't work... the drop-down list still shows the values in Ascending order.

      Isn't there an easy way to do this?


        • 1. Re: Isn't there an easy way to sort a value list?

          Here's a custom function (well, two related custom functions, actually) that will do the job. I use it all the time. Keep in mind that you'll need a copy of FileMaker Pro Advanced to install a custom function in your solution.


          Credit: Originally implemented in FileMaker custom function by Shaun Flisakowski Marts 2004 (www.clevelandconsulting.com). Theo Ros made another implementation (www.briandunning.com).

          • 2. Re: Isn't there an easy way to sort a value list?

            Oh, sorry. I didn't read your entire message.


            After sorting an array, I use this plug-in to display a drop-down menu in the order I want ... instead of the default sorted order used by FileMaker:




            You can even sort your values and then prepend or append items to be displayed in your drop-down menu, complete with separators between groups of menu items. Or you can create avalue list from scratch of items you want displayed in your drop-down menu. In other words, you can completely control the order in which items are listed in the drop down-menu. A very cool plug-in ...

            • 3. Re: Isn't there an easy way to sort a value list?

              Thanks Morgan. You've perfectly described the issue of what I'm talking about... why, after 12 versions and all these years, should i have to purchase a plug-in for each computer that's running my solution, just to be able to display a value listed sorted in reverse alphabetical order? This is something so simple to implement on Filemaker's end that it should be a top priority IMHO. FYI, I didn't see the custom function(s) you mentioned in your 8:17 AM post. Thanks.

              • 4. Re: Isn't there an easy way to sort a value list?



                Not sure what happened when I first tried to paste the linka to the custom functions that sort a value list, but here are the links:






                As for relying on a plug-in for better drop-down menus, I, too, resisted using a plug-in for this funtionality for years. But I find there is always a front and a back to every situation ...


                Once I bought CNS Menu, I kept finding ways to utilize it to make my interfaces much more intuitive and sophisticated. In addition to showing a lit of values, I can include menu items that can trigger all kinds of other processing. So, for example, I could display the most likely choices in a short list, followed by a separator followed by a menu item called "Search for other values ..." or some such. When a user chooses the "Search for ..." menu item, my script then invokes a selector of some kind that can search for whatever other the user might be looking for.


                I am amazed at how this powerful capability can eliminate the need for extra buttons (and thus reduce clutter) on a layout and save the users a lot of time in the process. Oh, and because CNS Menu suppoorts multi-level menus, I can, for example, when entering line items on an invoice, present a menu showing item groups, where each group expands into a sub-menu of the items in the group. This means a drop-down menu of several hundred choices can be condensed into a list of 10 or 12 groups, each of which expands, when moused over, to show 10  to 15 items. This not only is much less confusing that a really long list of all allowable values, but it also makes the job of chosing the correct value much, much faster for the users.


                And I often add litle extra choices to a drop-down menu based on the user's role. A database admin sees a richer set of options than a department head, a department head sees more options than a typical user, etc. The ability to customize drop-down menus based on the context (the type of transaction or the values in some other fields) and based on the user's role and privileges is way cool!


                No end to the possibilities ... Now I can't see how I would be able to build a sophisticated interface without this plug-in.

                • 6. Re: Isn't there an easy way to sort a value list?

                  This can be done, but it's not so simple.


                  This discussion might help: http://fmforums.com/forum/topic/75378-display-all-values-except-for-one/

                  • 7. Re: Isn't there an easy way to sort a value list?

                    Can anyone tell me why, when i set up the TO value list and configure the relationship to sort values in Descending order, why it doesn't display them in Descending order in the drop down list? This sounds like it's a bug in FM. It seems to me that this setting should control the order the list is displayed. Where do I ask FM to fix this bug?

                    • 8. Re: Isn't there an easy way to sort a value list?

                      Well, a bug is really something that should work a certain way, but doesn't. Value lists sort alphabetically regardless of any other context. So a bug, no. A missing feature? Perhaps.