3 Replies Latest reply on Jul 17, 2017 8:38 AM by philmodjunk

    Can I categorise conditional value lists?

    SeanSheppard

      Hi,

       

      I have set up conditional value list on a file I am setting up for my own personal use.

       

      This is slightly different as potentially two or more types can be selected and the sub type field (which is where the conditional list is) then needs to display all of the options for the type(s) selected. I have managed to display the relevant sub types but the issue is that all of the sub types are in one list, whereas I would like to categorise the values to make finding them easier

       

      As a work around I have chosen to display the values from 'Type' in sub type and sorted them in the order I want, but is doesn't look very neat and I wondered if there was a cleaner solution?

       

      Just so you're aware I am very much a novice with this and learn as I go along!

        • 1. Re: Can I categorise conditional value lists?
          mikebeargie

          Hi Sean,

           

          Sometimes in these cases, it's easier to create a simple table of values, rather than just a value list. You can't really subgroup value lists at all, so you'd have to explore an alternative, like using a webviewer based value list selection which can be pretty tricky to nail for integrating.

           

          What does adding a table get you? In this case, it would allow you to display a layout based list view instead of a checkbox set of your values. You could then subsummarize the list view for each of your categories, placing a button on each row that selects those subtype categories. You could also use alternate row styling as well to have a really nice looking selection list.

           

          You could also drop the "subtypes" records into a portal, then use a portal trick technique to "group" those together (calculation heavy, so I wouldn't do it if you have hundreds of subtypes)

          Here's an example: A Very Nice Way to Format a Sorted Portal Using Conditional Formatting

          Faster than trying to do a webviewer setup.

           

          Lastly, using the new Card window in FM16, or something like slide controls to switch between type and subtype selections can make for some good UI integrations.

           

          ----

          You're probably wondering now how a user would "Check" those items off. I would place a checkbox on the layout with your "subtype" table for each subtype record, EG Subtypes::checkmark. Then I would script a "save" button that gathered up the checked items like so, saving them to the main record before clearing them.

           

          Set variable [ $checklist ; ExecuteSQL("SELECT valuename FROM subtypes WHERE checkmark = 1";"";"") ]

          Show All Records

          Replace Field Contents [ subtypes::checkmark ; "" ]

          Close Window [ current window ] //CLOSE A CARD WINDOW IF YOU OPENED IT

          Set Field [ MainTable::Subtypes ; $checklist ]

           

          If you need to pop open that card window and "populate" the checkboxes from the main record so you can edit the values, you can reverse the logic in the above script:

          Set variable [ $checklist ; MainTable::Subtypes ]

          New Window [ Card ; Layout: Subtypes Layout ; Name: "Select Subtypes" ]

          Show All Records

          Sort Records [ no dialog ; subtypes::category ]

          Go To Record [ First ]

          Loop

               If [ PatternCount( $checklist ; subtypes::valuename ) > 0 ]

                    Set Field [ subtypes::checkmark ; 1 ]

               End If

               Exit Loop if [ Get(RecordNumber) = Get(FoundCount) ]

               Go To Record [ Next ]

          End Loop

          Scroll Window [ Home ]

           

          This is a lot to take in, and advanced stuff to integrate. If you have specific questions let me know!

          2 of 2 people found this helpful
          • 2. Re: Can I categorise conditional value lists?
            SeanSheppard

            Thanks for the response Mike,

             

            I think I see what you're getting at but I may need to try when I am in the right frame of mind as it seems more advanced than I am used to!

             

            I will respond here when I have had a chance to experiment with it properly to let you know how I got on

            • 3. Re: Can I categorise conditional value lists?
              philmodjunk

              From my smart phone:

              you might also use the magnifying glass tool to search this forum for:

               

              "Adventures in FileMaking" to find a pair of teaching files that provide examples of different techniques for choosing an item from a list. #1 deals with different options for conditional value lists and #2 shows other options such as using selection portals. Both come with detailed documentation on how each technique works. Both files contain download links to the other file.