4 Replies Latest reply on Dec 17, 2012 1:40 PM by philmodjunk

    Display icons based on a checkbox set

    MattSchuurman

      Title

      Display icons based on a checkbox set

      Post

           Hello,

           I am creating a directory from hundreds of records. One of the fields in my layout is a checkbox set, with about a dozen options to choose from (multiple boxes can be selected within a record).

           Some of the values in the checkbox set have quite lengthy names, and if one record has too many boxes selected, the names do not fit in the layout.

           I am importing the records from an excel database, so changing the names of the values in the checkbox set is not an option (as far as I know).

           In a perfect world, I would like to have each selected checkbox set represented graphically in my finished layout. For example, if the options were your favourite food, and one record has pizza and spaghetti selected, I would like those to be represented by a small icon or thumbnail of a pizza slice or a plate of spaghetti.

           Can this be done?

           Alternately, would there be a way for me to shorten the names in the value set, and still have the excel document match up properly? I will be importing records into this database frequently, so I would prefer not to have to do a "Replace Field Contents" every time.

        • 1. Re: Display icons based on a checkbox set
          philmodjunk

               I am importing the records from an excel database, so changing the names of the values in the checkbox set is not an option (as far as I know).

               Why not?

               You can use an auto-enter calculation to modify the data during import. You can use Replace Field Contents to change the data after it is imported and you can set up a new field that copies/modifies the data to keep the original values should that be necessary.

               If you can find text based icons such as is found in a symbol or dingbat type of font, you can use conditional formatting to hide/reveal the character if a specific value has been selected in the checkbox group. If you use graphic images, you can load such images into global container fields and use a calcualtion field, set to return a "container" data type that return the value of the global container if a specific value has been selected.

               In both cases, the expression would look like this if you wanted the character or image to be visible when "Apple" was selected in the check box field:

          Conditional format:(Set font size to 100+ if this expression is true to hide the character)

               IsEmpty ( Filtervalues ( YourTable::YourCheckBoxField ; "Apple ) )

          Using container fields with image files inserted into them:

               If ( Not IsEmpty ( Filtervalues ( YourTable::YourCheckBoxField ; "Apple ) ) ; Globals::gGlobalcontainerFIeld )

               Look up any of these functions that are new to you in Filemaker help to learn more.

          • 2. Re: Display icons based on a checkbox set
            MattSchuurman

                 Thanks PhilModJunk.

                 I believe this is the right answer, but I'm very new to filemaker, and I'm having trouble wrapping my head around the solution.

                 I'm using Filemaker Pro 9.

                 My table is named "Dir_Presenters", the checkbox field is named "Category", the first two values of "Category" are "Music: Classical", and "Music: Folk/Roots/Traditional"

                  

                 Would you be so kind as to provide step-by-step instructions to set up the graphic solution using container fields?

            • 4. Re: Display icons based on a checkbox set
              philmodjunk

                   I'll show you how to set this up for a selected value of "Music: Classical". And you should then be able to extend that approach to other values in the check box value list.

                   Define a field of type container, gMusicClassical. Use field options to specify global storage for it. Put it on a layout and insert the graphic that you want into the container field.

                   In Manage  database | fields, define a new field of type calculation in the same table as your checkbox field. Enter this expression:

                   If ( Not IsEmpty ( FilterValues ( Category ; "Music: Classical" ) )  ; gMusicClassical )

                   In the drop down for return type found in specify calculation, select "container".

                   You'd create one such calculation for each value in your checkbox field's value list.

                   The syntax I have used assumes that all three fields are defined in the same table, but you can define the global field in any table that you prefer.

                   There are two variations of this basic method, 1) is to use the same global field such as gMusicClassical to show which value has been selected for each and every checkbox, or 2) you can create a different global field for each value and thus use a different global container field in each of these calculations so that you can show a different graphic for each value.