6 Replies Latest reply on Feb 27, 2011 11:42 PM by DanielPinder

    Assigning a color to value list item?

    DanielPinder

      Title

      Assigning a color to value list item?

      Post

      Hi There,

      I have three fields all of which are pop-up menus drawing from the same value list. The reason there are three is to be able to assign up to three keywords to the record. I have assigned conditional formatting to each of the fields:

      if (table::themes1 = "Romance" ; 1 ; 0)

      But I have to re-enter everything three times. in addition, I have to choose the same color patch for the corresponding value list items each time. 

      Is there a better way to do this? Ideally, I would be able to assign each keyword a color in a global fashion, perhaps in a kind of "preferences" layout, the way I do for other global things.

        • 1. Re: Assigning a color to value list item?
          philmodjunk

          Are the values of your value list stored in a table? If not, put them in a table so that the table can be the source of values for your value list.

          Then define a container field in this table so that each value has a container field. Then insert different color rectangles into these container fields for each value.

          Now define a relationship between your original table and this value list table:

          OriginalTable::Theme = ValueTable::Theme

          You can add the container field from ValueTable directly to your original table's layout. Now, when you select a value in Theme, it's corresponding color will appear also. For three seperate fields, you'd need three different relationships from your original table to the valueTable. To avoid that, you could define a related table for your themes and use a portal to display up to three records (or as many as you need) in this portal. If you do this, then you'd link the portal table to valuetable instead of your original table.

          • 2. Re: Assigning a color to value list item?
            DanielPinder

            Great, Phil. You continue to be a font of knowledge!

            I also just discovered "Self" which would help efficiency in the formulas but not as nice as your solution. Thanks, my db is growing in leaps and bounds.

            • 3. Re: Assigning a color to value list item?
              DanielPinder

              "Are the values of your value list stored in a table? If not, put them in a table so that the table can be the source of values for your value list."

              Does this mean, create one field in a new table and create as many records as there are theme? Or do I create a theme field with repetitions?

              "Then define a container field in this table so that each value has a container field. Then insert different color rectangles into these container fields for each value."

              Did this.

              "Now define a relationship between your original table and this value list table:

              OriginalTable::Theme = ValueTable::Theme"

              Again, this implies there is only one theme field. I'm confused as to whether the value list is drawn from the contents of this field, or essentially where the value list comes from.

              "You can add the container field from ValueTable directly to your original table's layout. Now, when you select a value in Theme, it's corresponding color will appear also."

              What I'm unclear on is the fact that I've created 10 container fields, each with different colors. You're talking about a single container field now... Not clear on how one container field changes to show contents of another container field.

              Please pardon the ignorance!

              • 4. Re: Assigning a color to value list item?
                philmodjunk

                Does this mean, create one field in a new table and create as many records as there are theme?

                Yes.

                What I'm unclear on is the fact that I've created 10 container fields, each with different colors. You're talking about a single container field now... Not clear on how one container field changes to show contents of another container field.

                I'm suggesting that you either discard your original container field and replace it with the related container field or to define your existing container field to use a looked up value field option to copy the value from the related record. Don't use the looked up value field option unless you do not want changes made to the related record's container field to automatically change the color you see in all your records.

                I'm unclear as to why you have 10 different fields here. Can you describe your set up in more detail? In general, a table of related records can be used in place of a repeating field to get a much simpler and more flexible structure without losing most of the interface features that made the repeating field desirable to use in the first place. Even horizontal rows of data with columns of related records is possible to set up.

                • 5. Re: Assigning a color to value list item?
                  DanielPinder

                  I see now. Yes I was using a repeating field to handle the job of having a table with multiple records, which is what I should be doing. It's odd because I have other tables doing this exact job elsewhere, but I didn't think to do it here. I get by with a little help from people like you. Will report back on my success.

                  • 6. Re: Assigning a color to value list item?
                    DanielPinder

                    I got this working—many thanks.