4 Replies Latest reply on Nov 8, 2016 8:36 AM by justinc

    hide item when checkbox


      I have an inventory database with a field that is a checkbox called "Furniture" (allowing multiple furniture pieces to be selected).  Basically the user would check all items in a room.


      If one of the pieces of furniture that the user checks is "TABLE", then we want another field to be NOT HIDDEN which allows them to select the type of table (end, pool, kitchen, dining room, etc) that it is.  So the user checks TABLE in the first field and a second field should immediately appear to allow the user to check what type of TABLE it is.


      This is easily achieved by adding to "hide object when" PatternCount ( SCENE::furniture; " table" )) to the second field.


      BUT ... in the first field we now have MASSAGE TABLE as an entry.  So we have TABLE and MASSAGE TABLE as two separate items the user can click in the first field.


      If the user selects TABLE we want the second field to appear.

      If the user selected MASSAGE TABLE and TABLE is not selected as well, we don't want the second field to appear.

      if the user selects TABLE and any combination of other checkboxes, we want the second field to appear.


      This should be easy, but I can't get my pee sized brain to figure this one out.


      Any help would be appreciated!!

        • 1. Re: hide item when checkbox

          What exactly is the form of the content of the "Scene::Furniture" field?  It sounds like you have multiple values in it.
            Is it like this:





          Or something more like:

          Table, Chair, Rug




          I'm going to assume the first option, a return separated list.  If so, then you could use FilterValues() to check for the presence of "Table" in the list.  If the FilterValues() function returns empty, then the word "Table" does not exist in your list.  E.g.:


          isempty ( filtervalues ( "Table" ; Scene::Furniture) )  )


          This will be completely independent of the "Massage Table" entry, if it is in your list, because FilterValues() compares the entire line, not just the word.


          --  Justin

          1 of 1 people found this helpful
          • 2. Re: hide item when checkbox

            I assume:

            1.     You have a field in which the user selects the value "Table", and that this field is entered from a Value List.

            2.     You have a second field with an associated Value List giving various types of Tables.

            I would think, therefore, that you would want this second field to be hidden whenever the first field is NOT "Table", so the Hide condition should be: firstField ≠ "Table".


            Now I am not clear whether Massage Table is an option in the first field or the second. Since you post it as messing things up I assume it is in the first field. If so, then it will certainly trigger visibility of the second field, since it includes "Table" as a separate word. A simply fix might be to make sure the value is recognised as a single word instead, which could be achieved either by (1) entering a hard space between Massage and Table, or (2) using camel case: MassageTable; and ensuring the field is populated with this value.

            • 3. Re: hide item when checkbox

              @justinc ... that was exactly what I needed.  thank you!

              • 4. Re: hide item when checkbox

                Cool, glad to hear it!