7 Replies Latest reply on Oct 21, 2016 8:36 PM by sliprat

    Help with variables on a sheet of address labels

    sliprat

      I'm sure this has been asked before, but I can't find the answer anywhere...

       

      My customers can choose to have their product mailed to a choice of 1 of 2 different addresses.  I would like to populate a sheet of labels using the address that they selected to have the product mailed to.  I thought using a merge Variable would be the best approach, but it repeats the same address throughout the sheet of labels, no matter the customer.  I'm stumped now as to the best approach.  Any and all help would be greatly appreciated!

       

      Label using merged Variables:

      Lable with Vairable.jpg

      Produces

      Label Page.jpg

      Script:
      Script.jpg

       

      Thanks for you help!

        • 1. Re: Help with variables on a sheet of address labels
          philmodjunk

          As you have discovered, this is not something that you can use a variable for.

           

          You have two basic approaches

           

          1) Use a relationship that, for each record matches only to the specified address and then use fields from the related table occurrence on your layout.

          2) Define calculation fields that return one address or the other and use the calculation fields on your labels layout.

          1 of 1 people found this helpful
          • 2. Re: Help with variables on a sheet of address labels
            sliprat

            Thank you Philmodjunk,

             

            Would you or someone out there be kind enough to get me started down the correct path with an example calculation?

            • 3. Re: Help with variables on a sheet of address labels
              philmodjunk

              A self join relationship might be simpler but:

               

              If ( Students::Proof Mailing Location = "Local Address" or

                   IsEmpty ( Students::Proof Mailing Location ) or

                   Students::Proof Mailing Location = "Do Not Mail Home Proofs" ;

                   List ( Students::Secondary Address Line 1 ;

                           Students::Secondary Address Line 2 ;

                           Students::Secondary City & ", " & Students::Secondary State & " " & Students::Secondary zip code ) ;

              /*Else*/  List ( Students::Address Line 1 ; 

                            Students::Address Line 2 ;

                           Students::City & ", " & Students::State & " " & Students::zip code )

                  ) // if

              • 4. Re: Help with variables on a sheet of address labels
                philmodjunk

                BTW, the If steps in your script are not set up correctly. Compare them to how I set it up in the If function in my last post to see the difference.

                • 5. Re: Help with variables on a sheet of address labels
                  sliprat

                  philmodjunk,

                   

                  Thank you so very much!  This will definitely get me going.

                  • 6. Re: Help with variables on a sheet of address labels
                    sliprat

                    Hi philmodjunk,

                     

                    Another question. 

                     

                    If it calls to use a field but finds that it is empty, I'd like it to revert to the other field.  I tried this, modification to see if I could get it to work at least half way, but it isn't working.  May I get some more help from you?

                     

                    My Modification.jpg

                    • 7. Re: Help with variables on a sheet of address labels
                      sliprat

                      Hi philmodjunk,

                       

                      I figured it out. 

                       

                      This may not be the cleanest but for anyone else who is learning and may run across this post in the future, this is how I modified the calculation philmodjunk helped me with to use the opposite field if it was empty.

                       

                       

                      If ( not IsEmpty ( Secondary Address Line 1 )and Proof Mailing Location = "Local Address" or not IsEmpty ( Address Line 1 ) and

                           IsEmpty ( Proof Mailing Location ) or not IsEmpty ( Secondary Address Line 1 ) and

                           Proof Mailing Location = "Do Not Mail Home Proofs";

                           List ( Secondary Address Line 1 ;

                                   Secondary Address Line 2 ;

                                   Secondary City & ", " & Secondary State & " " & Secondary ZIP Code ) ;

                      /*Else*/  List ( Address Line 1 ;

                                    Address Line 2 ;

                                   City & ", " & State & " " & Zip )

                          ) // if

                       

                       

                       

                      Since this creates a list, you have to use one data field and you have to make sure your field box is large enough to contain the entire contents.

                       

                      Thanks again!