1 2 Previous Next 23 Replies Latest reply on Nov 24, 2014 8:57 AM by tays01s

    Conditional value lists

    tays01s

      Title

      Conditional value lists

      Post

      I'm after producing a value list of 'products' dependent on whether these are available from a specific Company, Country or have individually been selected. I've planned to do this with a Selection table and a Product TO and the following relationships:

      Selection::__ID = ProductTO::_SelectionID

      Selection::Company = ProductTO::Company [Selection layout has a checkbox selection]

      Selection::Country = ProductTO::Country [Selection layout has a checkbox selection]

      Selection::Product = ProductTO::Product [Selection layout has a portal from]

      & conditional lists on Selection are from:

      a. 1st field ProductsTO::__ID, 2nd field Products::Company, include all values

      b. 1st field ProductsTO::__ID, 2nd field Products::Country, include only related values from Selection. However, using the 'related values' option results in 'no values' on the Selection layout.

      I am stuck at this stage but assume the same problem would apply to any value list for Products::Products.

       

        • 1. Re: Conditional value lists
          philmodjunk

          I'm afraid that your relationship makes no sense here. It matches a single record in Selection to a record in Product if:

          The IDs match AND the Company matches AND the Country matches AND the product matches. That would seem to link exactly one record, if any, in Selection to one record in ProjectTO.

          A conditional value list would normally work off of a relationship that matches by some kind of category value such as the company that matches to an entire set of values that you then want to see in your value list.

          I suggest backing up here and describing what you want your selection table to select, how and why so that we can set up relationship that will work for your conditional value list.

          You might also refer to this exploration file: "Adventures in FileMaking #1 - Conditional Value LIsts" for detailed examples of how to set such a conditional value list.

          • 2. Re: Conditional value lists
            tays01s

            OK.

            1. Selection::Company should list all the companies for which there are products.

            2. Selection::Country should list all the countries for which there are Products, providing a Company a) has products in that country and b) their are products in countries for which Company has been checked (ie. checkbox field listing Companies.

            3. Selection::Product in a portal from Products lists all products providing there is a product for the Companies and Countries checked in the above fields.

            4. Finally, I need a conditional list for products that meet the above 3 conditions.

            • 3. Re: Conditional value lists
              ChadBarnard

              Stephen, 
              It sounds like you need the "Hierarchical Value List" that Phil spells out for you in the link above.  It worked for me and taught me a lot about Filemaker in the process.

              • 4. Re: Conditional value lists
                philmodjunk

                I agree and please compare the relationships specified in the adventure file to what you have in your file. Judging by your original post, you'll need to modify those relationships.

                • 5. Re: Conditional value lists
                  tays01s

                  I'm making some headway with this thanks.

                  A simple Q: When a box, within a checkbox field is checked, what value does it have? And, when I uncheck a box in the 'parent' value list field, the appropriate choices in the 'child' field value list disappear, but how do I also automatically uncheck them, otherwise, they remain checked and cause choices from the 'grandchild' field value list to remain on display?

                  • 6. Re: Conditional value lists
                    philmodjunk

                    You may find it helpful to look at "Adventures in FileMaking #2 - enhanced value seelection". Several of the layouts in this file put an edti box formatted copy of a field on the same layout as a check box formatted copy so that you can see the data in the field change as  check boxes are selected or cleared. You'll find that each time you click a check box, the corresponding value from the value list is inserted into the field. When more than one box is selected you see each value separated by a return character and in the order that the user clicked the check boxes.

                    For the issue at hand, I suggest using an OnObjectSave trigger on the first field that performs a script that clears the values from the second field. That way, a change in category in the first field will clear the selected values from the second field.

                    Since you describe using check boxes, a more sophisticated method is to set such a trigger performed script to remove just the values that are no longer a member of the selected categories in the first field.

                    Set Field [ YourTable::SecondFieldHere ; FilterValues ( ValueListItems ( Get ( FileName ) ; "ConditionalValueListNameHere" ) ; YourTable::SecondFieldHere ) ]

                    You may need to do a commit records just before this set field step to get the correct results.

                    • 7. Re: Conditional value lists
                      tays01s

                      Back to the original part of my question, I think a problem I'm having is that the hierarchy of Company to Country to Product is all in the Products table. I'd been hoping to use TOs of this. However, in your examples you seem to have Region, County, City in different fields. Do I need to put the hierarchy in different tables?

                      • 8. Re: Conditional value lists
                        philmodjunk

                        It would seem logical to me to use separate tables as I wouldn't want to have to edit data specific to one country in multiple records. (Say a country's name changes or you enter it incorrectly and have to later go back and correct the error.) And countries DO change their names such as Rhodesia becoming Zimbabwe...

                        But multiple TO's could be set up to make this work. It's just not what you spelled out in your original post here and thus I have suggested that you compare your relationships to those found in the Adventures in FileMaking exploration file.

                        • 9. Re: Conditional value lists
                          tays01s

                          Relationships & hierarchy appear to now work.

                          'Value List Adventure 2', 'checkboxes with scrollbars', 'New method', 'checkbox' would be handy to use, but I can't figure out how you appear to have combined the textbox X into the field and yet the text in the field doesn't get covered.

                          • 10. Re: Conditional value lists
                            philmodjunk

                            There's something like 6 different ways to do this all  demonstrated on one layout. Which one is the one in question? If you are referring to the calculation field formatted as a check box, it is sized to be barely larger than the actual box so that the value list value associated with that box is not visible.

                            • 11. Re: Conditional value lists
                              tays01s

                              The attached confirms the example. What I still don't get is that the checkbox appears to be part of the field (I can't dissect them apart), yet the text of the dialogue box remains to the right of the checkbox. Also the checkbox appears to be a textbox, but I can't grab it like an object.

                              • 12. Re: Conditional value lists
                                philmodjunk

                                There is no attached so I still do not know which of the 6 examples has you puzzled. That makes it tough to understand the precise issue. In addition to a calculation field formatted as a check box, there's everything from conditionally formatted text, to container fields to graphic objects with "hide object when" settings in these different examples.

                                • 13. Re: Conditional value lists
                                  tays01s

                                  Sorry, I've now attached it.

                                  What I still don't get is that the checkbox appears to be part of the field (I can't dissect them apart), yet the text of the dialogue box remains to the right of the checkbox. Also the checkbox appears to be a textbox, but I can't grab it like an object.

                                  • 14. Re: Conditional value lists
                                    philmodjunk

                                    Your confusion points out a deficiency in the documentation on how these portals were designed.

                                    There are three layout objects in this portal row--one of which is invisible. The "x" is simply red, bold layout text with a conditional format that makes it appear and disappear by changing the font size. It seems like one object because the two visible objects, the X and the field name have been grouped with an invisible button object.

                                    I put the "X" on the layout, formatted it how I wanted--including the conditional format. I then selected this object and the field object to the right by shift-clicking. By selecting "Button Setup" from the Format menu, I then selected the Perform Script button option so that clicking either the "X" or the field will perform this script. The act of formatting a group of layout objects as a single button groups them all with an invisible button option that gets the properties you specify via button set up.

                                    To further dissect the design, enter layout mode and make a copy of the portal and the objects inside the portal row. Then use Ungroup from either the Inspector or the arrange menu. This destroys the button object, but now you can check the design options specified for the objects that make up that button.

                                    1 2 Previous Next