8 Replies Latest reply on Apr 27, 2017 11:49 AM by siplus

    How to add one extra item in Value Lists

    nexgen

      I have created a value list based on Products table.

       

      However, while selecting products, sometime I need to select all products. While showing product name in popup menu, I want to show one more value called "All" for denoting that it applies to all products.

       

      How can I do that?

        • 1. Re: How to add one extra item in Value Lists
          philmodjunk

          I call such values an "action value" as you want an action to take place more sophisticated than simply selecting the value.

           

          What I am suggesting assumes unique product names and will require an additional relationship matching records by product name.

           

          Add this calculation field to Products with a Text result type:

           

          List ( Product Name ; "-" ; " All" )

           

          Use this in place of the product name field in your value list set up. Make Product Name the only field specified in the value list. do not specify a product ID. Add a product name field to your layout to format with this value list if you do not already have a product name field on it to use for this purpose.

           

          note the space before the "A" in " All". This will sort the All value to the top of the list followed by a value separation line added by the "-".

           

          Make a new relationship of products that you link by product name in the new occurrence of products to the product name field that you format with this value list. Take the Product ID field that you normally would format with a value list of product ID and Product Name and set it to auto-enter the product ID from the new occurrence of products that matches by name. When you select a product, the auto-enter option will copy over the ID so that you can link by product ID instead of by name. Note that this value list can be used as an auto-complete enabled drop down list which is not possible with a value list where field 1 is the product ID and field 2 the name.

           

          A script trigger on the value list field (OnObjectModify or OnObjectSave) can perform a script that checks for " All" in the product name field. The script can then select all products.

           

          The above assumes a line items table and portal for selecting products.

           

          If you are using a different format, other methods may be needed--such as adding a button to select all check boxes in a check box formatted field--though that set up is not as ideal as a portal to a related table of line items.

           

          To see working examples of action value lists and auto-complete value lists that link records by ID you can examine this teaching file:

           

          Adventures in FileMaking #2--enhanced value selection

           

          The examples in this file come with detailed documentation on how they work and how they were set up.

          1 of 1 people found this helpful
          • 2. Re: How to add one extra item in Value Lists
            user29424

            If your value list is based on a table of products then I think the only way you can do this is by adding a product called all to the products and then write a script that then adds all products if the product called all is selected. You could create a field in the products table that flags that product to be the one that adds all the others and you could also use that flag to hide that product from normal listings.

             

            You could make a pseudo list using a popover with a portal that lists all the products, then have a checkbox on each row that would flag them for adding. And outside that portal you could have button that would check all the products at once. Again, you'd have to write a script that both adds the products to another table and unflags them once they've been added.

             

            That's just two ways to solve it. I'm sure there's plenty of other ideas out there as well.

            1 of 1 people found this helpful
            • 3. Re: How to add one extra item in Value Lists
              siplus

              A value list has a specific purpose: select a value from a list of different values, each having a common property: they are values. You want to distort the base concept, as "all" is not a value.

               

              Just put a button (select all) before the value list - which now reads "or pick a specific product:" so that the user doesn't even need to enter the value list if what he wants is to catch'em all.

              1 of 1 people found this helpful
              • 4. Re: How to add one extra item in Value Lists
                beverly

                That seems like really good UI and UX! thanks, siplus.

                • 5. Re: How to add one extra item in Value Lists
                  nexgen

                  Thank you all for the helpful answers.

                  • 6. Re: How to add one extra item in Value Lists
                    taylorsharpe

                    This brings up one thing that I really wish FileMaker would do.  If you could make a value list from an ExecuteSQL, then I would be infinitely more flexible in creating value lists.  If they could make the Value list just a calculation engine feature just like conditional formatting or anything else.  You would have to select context, but my drop down value lists would be much more useful and flexible.  Right now I have to do lots of popover on open triggers in a virtual list which is just a lot of work compared to if there was a simple calculation in the value list feature. 

                    • 7. Re: How to add one extra item in Value Lists
                      beverly

                      If this then allows a "custom sort" (part of the SQL ORDER BY clause) rather than alphabetical, that would be the bees' knees!

                      • 8. Re: How to add one extra item in Value Lists
                        siplus

                        actually I'd fancy a "no sort" option, which would allow me to insert separators ("-") at specific points...