4 Replies Latest reply on May 28, 2010 2:05 PM by philmodjunk

    Field that stores multiple checkbox values

    therin

      Title

      Field that stores multiple checkbox values

      Post

      Hi all,

       

      I'm trying to get a text field to store multiple values from one checkbox value list into one record. I have one global field named grade_years, and a value list that includes 6, 7, 8... and so on until 12th grade. I would like to be able to select multiple grades (such as 8,9 and 10) and have the global field grade_years display as : 8 9 10.  I know it's probably pretty easy to do with a calculation field, I just haven't been able to figure out how to do it. Any help would be appreciated, thanks.

       

      Therin Irwin

        • 1. Re: Field that stores multiple checkbox values
          philmodjunk

          I'm not sure exactly what you want here. You appear to want a checkbox formatted global field to display it's selected values in two different formats, one as a typical list of check box options and one as just a horizontal list of the selected values separated by spaces. I'm afraid you can't have both with just one field.

           

          You can, however, define a calculation field that converts the return separated list of selected values--that's how checkbox selections are stored in the field--into such a horizontal list.

           

          Define a calculation field as:

           

          Substitute ( YourTable::grade_years ; ¶ ; " " )

           

          And you'll get your horizontal list of selected values.

          • 2. Re: Field that stores multiple checkbox values
            therin

            Thanks - that works great. I wanted to get the values enter by the user in a horizontal list. I guess all of the values were there anyway, I just couldn't "see" them because they were all separated by carriage returns.

            1 of 1 people found this helpful
            • 3. Re: Field that stores multiple checkbox values
              raybaudi

              PhilModJunk wrote:

               

              Substitute ( YourTable::grade_years ; ¶ ; " " )

               

              And you'll get your horizontal list of selected values.


              ... but that horizontal list will show the values in the order that they were checked.

               

              So you'll can have a row like this: 10 12 8 9 instead of 8 9 10 12

               

              To prevent this result it's better this calculation:

               

              Substitute ( FilterValues ( ValueListItems ( Get ( FileName ) ; "age" ) ; grade_years ) ; ¶ ; " " )

               

              where Age is the name of the custom value list.


              • 4. Re: Field that stores multiple checkbox values
                philmodjunk

                it's better this calculation...

                 

                An excellent improvement on the basic concept!