2 Replies Latest reply on Oct 15, 2014 9:15 PM by user19752

    RE-ordering checkbox selection list

    kwojnar

      Yet another formatting question from the new guy ...

       

      Is there a way to re-order the items in the checkbox/radio button selection list from an external table ? I see there is a "Re-sort values based on:" check box in the 'specifiy fields for value list' window but regardless of if it is checked or not, the order doesn't change on the form. Very simple example - 2 column table with index value column and description value column. Indexes are 1 and 2 with associated descriptions 'A' and 'B' . The form always displays in order A and B regardless of the index value (Index for A = 1 or index for A = 3) I want B to display first in this simple example but it appears that the displayed list is always descending alpha based on the displayed list description value. Not sure if it make a difference but the value stored in the database is the index.

       

      I have tried sorting the list items internally in the table based on the index/key as well as sorting by the data values. Tried adding rows to the table that the value list is pulled from but the sort is always alpha according to the displayed value. Don't see any documentation on the sort beyond sorting in table view and couldn't make that work either.

       

      Thanks for any suggestions or if anyone can point me to a good reference source where I might find answers to these questions. Have looked through the user guide v13.

       

      Also is there any comprehensive reference material covering all functionality ?

        • 1. Re: RE-ordering checkbox selection list
          Mike_Mitchell

          There are a couple of possibilties:

           

          1) You can use a second field and sort the value list by that.

          2) You can prepend a value that causes the value list to sort alpha, but in an order you force. For example:

           

          01) My first value

          02) My second value

          03) My third value

           

          Hacky, but works.

           

          3) There's always this clever little hack: It's Sorta a Value List Thing from Jonathan Fletcher.

           

          HTH

           

          Mike

          • 2. Re: RE-ordering checkbox selection list
            user19752

            4) Someone find 10 characters that invisible. Then

            NumToInvisibleText ( number ; maxlen ) custom function convert sort order to invisible text.

            Use the result as 2nd field with set index to 'UNICODE'.

            (number used as sort order should be 0..10^100-1 of integer. maxlen is digit of max number.)

             

            Let ( [

                d = Length ( number ) ;

                s = Case ( d <= 100 ; Substitute ( 10 ^ maxlen + number ;

                    [ "0" ; Char ( 8203 ) ] ; // ZERO WIDTH SPACE

                    [ "1" ; Char ( 8204 ) ] ; // ZERO WIDTH NON-JOINER

                    [ "2" ; Char ( 8205 ) ] ; // ZERO WIDTH JOINER

                    [ "3" ; Char ( 8206 ) ] ; // LEFT-TO-RIGHT MARK

                    [ "4" ; Char ( 8207 ) ] ; // RIGHT-TO-LEFT MARK

                    [ "5" ; Char ( 8234 ) ] ; // LEFT-TO-RIGHT EMBEDDING

                    [ "6" ; Char ( 8235 ) ] ; // RIGHT-TO-LEFT EMBEDDING

                    [ "7" ; Char ( 8236 ) ] ; // POP DIRECTIONAL FORMATTING

                    [ "8" ; Char ( 8237 ) ] ; // LEFT-TO-RIGHT OVERRIDE

                    [ "9" ; Char ( 8238 ) ]   // RIGHT-TO-LEFT OVERRIDE

                ))

            ] ;

                Replace ( s ; 1 ; 1 ; "" )

            )

            1 of 1 people found this helpful