5 Replies Latest reply on Sep 1, 2016 8:30 PM by user19752

    ValueListItems reverts TextStyleAdd

    realgecko

      Dear All,

       

      I am working in the simple relationship shown in screenshot1,

       

      In the table combined_data, the field Spanish_name_superscript_study_code is defined by this function:

      If ( not IsEmpty ( Spanish vernacular name ) ; Spanish vernacular name & TextStyleAdd ( Study code ; Superscript ))

      As this field contains duplicates, I set up a conditional value list "Spanish_names", for which I chose combined_data::Spanish_name_superscript_study_code as values and selected "use only related values from" the plants table (see screenshot 2).

      When I now execute the function

      ValueListItems ( Get ( FileName ) ; "Spanish names" )

       

      Everything works as expected, with one exception: the  TextStyleAdd ( Study code ; Superscript ) appears as reverted to "Plain". Strangely enough, this does not happen using the list function rather than the valuelistitems function (see screenshot 3; where the Spanish vernacular names field displays the List returns with superscript yet also duplicates and the Spanish names_unique field displays the ValueListItems returns, without duplicates yet Superscript reverted to plain).

       

      Any ideas on what's wrong?

       

      Screen Shot 2016-08-27 at 4.08.43 PM.png

      Screen Shot 2016-08-31 at 1.42.20 PM.png

       

      Screen Shot 2016-08-30 at 4.58.53 PM.png

        • 1. Re: ValueListItems reverts TextStyleAdd
          Johan Hedman

          Value Lists dont show data with Text Formats

          • 2. Re: ValueListItems reverts TextStyleAdd
            philmodjunk

            This is because this function retrieves data from an index instead of directly from a field.

             

            But if you still want that text style, you can put it back in as part of your expression that uses ValueList Items.

             

            TextstyleAdd ( ValueListItems ( Get ( FileName ) ; "Spanish names" ) ; SuperScript )

            1 of 1 people found this helpful
            • 3. Re: ValueListItems reverts TextStyleAdd
              realgecko

              Yes, sure but this would return the entire valuelist in superscript, whereas I only need a portion of every single value in superscript the rest remaining plain. So, I suppose that means that using the ValueListItems, there is no way to return teh values I need. Or does anybody have an alternative idea for this issue?

              • 4. Re: ValueListItems reverts TextStyleAdd
                realgecko

                Thank you! it works if I nestle the textstyleadds within the substitute function:

                Substitute ( ValueListItems ( Get ( FileName ) ; "Spanish_names" ) ; ["¶" ; "; "]; ["1"; TextStyleAdd (1; Superscript)]; ["2"; TextStyleAdd (2; Superscript)]; ["3"; TextStyleAdd (3; Superscript)]; ["4"; TextStyleAdd (4; Superscript)]; ["5"; TextStyleAdd (5; Superscript)]; ["6"; TextStyleAdd (6; Superscript)]; ["7"; TextStyleAdd (7; Superscript)]; ["8"; TextStyleAdd (8; Superscript)]; ["9"; TextStyleAdd (9; Superscript)]; ["0"; TextStyleAdd (0; Superscript)]  )

                 

                maybe not the most elegant solution but at least it works

                • 5. Re: ValueListItems reverts TextStyleAdd
                  user19752

                  "Quote" the styled field used in value list

                   

                  If ( not IsEmpty ( Spanish vernacular name ) ; Quote ( Spanish vernacular name ) & "&TextStyleAdd (" & Quote ( Study code ) & "; Superscript )" )

                   

                  then get styled list

                   

                  Evaluate (

                  Substitute ( ValueListItems ( "" ; "Spanish names" ) ; ¶ ; "&\¶&" )

                  )

                   

                  Note: There is limit of max length for Evaluate().

                  1 of 1 people found this helpful