1 Reply Latest reply on Nov 4, 2015 3:06 PM by Extensitech

    Convert several individual fields to checkbox set?

    jdevans

      I Figured it out, using a script. Works pretty well, even though I had to hard-code in the number of fields on the 2nd layout. It loops thru each field on the  layout, and updates the variable to whatever fields are X'd. Then goes to the original layout and sets the checkbox set according to the variable.

      See the attachment that contains the un-commented script.

       

      I have a group of 7 independent fields which need to be converted to a single field that uses a checkbox set w/ related value list.

       

      I have come up with a sure fire way of doing this using a Case statement in a calculated field. But as long as the number of fields to convert is manageable (say, no more than 5), I can use it. But now with seven fields each of which has a value of null or X, I have 2^7 possible combinations of checkboxes. That's 128 Case statement tests.

       

      Any one have an idea of how I can do this prgramatically but in a way that isn't so tedious?

       

      Example:

      Field1-x

      Field2-""

      Field3-x

      Field4-x

      Field5-""

      Field6-""

      Field7-x

       

      CheckboxField- values:     If Field1=x; Red; ""

                                             If Field2=; Blue; ""

                                             If Field3=x; Yellow; ""

                                             If Field4=x; Orange; ""

                                             If Field5-x; Black; ""

                                             If Field6-x; Purple; ""

                                             If Field7-x; Brown; ""