Formatting Addresses on the questionnaire and in the generated document

There are different ways to collect information and also different ways to have that information formatted in the generated document. In fact, the way you collect address information on the questionnaire can be different to how you then subsequently format that data in your generated documents. Moreover that data can be formatted in different ways in different places in the document (e.g. sentence format in the Parties section of the document and line format in the signature block section of the generated document).
Decisions on how you collect your variables should always take into consideration how the user would most likely want the data to be captured along with your preference as the Author of the document.
It is important to note that this does not have to be limited to addresses. Any questions that can be collected using the types mentioned below can be subject to formatting in this way.

Input

There are 2 usual methods of collecting address data: Multiline text boxes and Separate fields:
Multiline Text box
Here one variable would be created (in this instance called "ML_AddressParty1"). It's type would be set to multiline text. This would be shown on the questionnaire thus:
As you can see, this gives great flexibility to the user when filling in the questionnaire. The address can be long or short and is not restricted by country limitations. You may find it beneficial to add guidance to ensure they add the address on separate lines within the box. You also have a choice of how big the box should be using the Height property of the variable, the default Height is set at 6 lines.
Separate Fields
Alternative to a multiline is by separating each line out into a different question. These can be all text variables or more usually a combination of text and text selection to minimize typing for the user and control which questions are asked based on the country of the address picked from the dropdown:
eg - questions for when United Kingdom is picked as the country
eg - when United States of America is chosen - different questions can be shown

Output

The way the variable is formatted in the generated document can be different to the way the information is collected on the questionnaire.
Multiline Text box
Multiline text boxes can be formatted in the generated document in one of two ways:
i. Line format (especially useful for signature blocks):
Markup
Output in generated document:
{ML_AddressParty1 Format "^L"}
8-11 St John's Lane
London
EC1M 4BF
ii. or sentence format (replacing line breaks with comma spaces):
Markup
Output in generated document:
{ML_AddressParty1 Format ", |, |"}
8-11 St John's Lane, London, EC1M 4BF
Separate Fields
There are 3 options when you use separate fields:
i. Individually, for example:
Markup
Output in generated document:
{T_Address_Line1_Party2 Format ", |, |"}, {T_Address_City_Party2}, [
USParty2
{TS_Address_State_Party2}][
UKParty2
{TS_Address_County_Party2}][
CanadaParty2
{TS_Address_Province_Party2}][
OtherCountryParty2
{T_Address_Region_Party2}], {T_Address_Zip_Party2}
8-11 St John's Lane, London, EC1M 4BF
ii. Line format:
Markup
Output in generated document:
{T_Address_Line1_Party2 Format "^L"} {T_Address_City_Party2} [
OtherCountryParty2
{T_Address_Region_Party2}][
UKParty2
{TS_Address_County_Party2}][
CanadaParty2
{TS_Address_Province_Party2}][
USParty2
{TS_Address_State_Party2}] {T_Address_Zip_Party2}
8-11 St John's Lane
London
EC1M 4BF
iii. Computation Variable
The third and most preferred option is to create a computation variable that will store the data collected from each field in one bundle. For example a variable may be created called Party2Address with a type of computable and defined as:
If
TS_Address_Country_Party2 Is "United States" Then List(T_Address_Line1_Party2, T_Address_City_Party2, TS_Address_State_Party2, T_Address_Zip_Party2 )
Else If
TS_Address_Country_Party2 Is "United Kingdom" Then List(T_Address_Line1_Party2 , T_Address_City_Party2, TS_Address_County_Party2 , T_Address_Zip_Party2 )
Else If
TS_Address_Country_Party2 Is "Canada" Then List(T_Address_Line1_Party2, T_Address_City_Party2, TS_Address_Province_Party2, T_Address_Zip_Party2)
Else
List(T_Address_Line1_Party2, T_Address_City_Party2, TS_Address_Province_Party2, T_Address_Zip_Party2 )
We can then use that in the document to reduce the markup:
Markup
Output in generated document:
{Party2Address Format ", |, |}
8-11 St John's Lane, London, EC1M 4BF
{Party2Address Format "^L"}
8-11 St John's Lane
London
EC1M 4BF

Best Practice

Clearly the multiline text box option is easiest for the Author and gives the most flexibility for the user filling in the questionnaire. The address can be any number of lines long and inputted in any way the user would like. However this flexibility could become a problem if there is any possibility of the user becoming confused as to what to enter in this box. Indeed it also leaves open the possibility of a missing or incomplete address entry. In addition no reporting can be done against a multiline text box type variable since State is part of the one Address answer and Country may not even be input by the user.
In this way the separate fields approach, although taking a bit more in design time, may yield better answers from the user. There is also an argument that the users may be more familiar with this approach to collecting addresses from other online services such as Amazon and PayPal etc.