2 Replies Latest reply on Mar 27, 2015 9:49 AM by tdeppen

    Adding asterisks to a barcode case statement

    tdeppen

      Title

      Adding asterisks to a barcode case statement

      Post

      I have the following case statement for an address barcode field, and all I want to do is know how to add "*" asterisks to the beginning and end of the returned value....OH, and I also need to know how to remove any "," (commas) from the address as well. Here is what I have so far:

      Case ( 
      not IsEmpty  ( Delivery Instructions ) ; TrimAll ( Delivery Instructions ; 1 ; 3 ) ; 
      Location = "NONE" ; TrimAll ( Address ; 1 ; 3 ) ; 
      not IsEmpty ( Location ) ; TrimAll ( Location ; 1 ; 3 ) ; 
      not IsEmpty ( Address ) ; TrimAll ( Address ; 1 ; 3 )
      )

        • 1. Re: Adding asterisks to a barcode case statement
          philmodjunk

          let ( Label = Case ( Not IsEmpty ( Delivery Instructions ) ; Delivery Instructions ;
                                          Location = "NONE" ; Address ;
                                          Not IsEmpty ( Location ) ; Location ;
                                          Not IsEmpty ( Address ) ; Address
                                         ) ; // Case
                "*" & Substitute ( TrimAll ( Label ; 1 ; 3 ) ; "," ; "" ) & "*"
              ) // Let
                                         

          • 2. Re: Adding asterisks to a barcode case statement
            tdeppen

            Thanks for the input!! I was able to use part of your calculation in a barcode for name of recipient as well, where I was having the same issue:

            Let ( Label = If ( not IsEmpty ( SHIP TO ) ; NAME OF REQUESTER ; "" ) 
             ; // Case "*" & Substitute ( TrimAll ( Label ; 1 ; 3 ) ; "," ; "" ) & "*" ) // Let