Data is imported and stored in WordFly through data fields. These can be set up in different formats: text, number, and date data fields. Text data fields allow you to import any data from your list into WordFly, regardless of the data format. You can even import HTML from your list into a text data field. In this article we will review what you should know for importing HTML into text data fields.
Import HTML into text data fields
Text data fields can be created to import any data in your list if you plan on formatting that data on your own. Text data fields are ideal for importing HTML content from your list into WordFly.
Note: Number and Date data field formats apply specific formats during the list import process. Learn more about number and date data fields.
Text format data fields in WordFly
First you will need to create your text data field that will be used for mapping to your HTML data in your list. To create a new text format data field in WordFly go to Subscribers > Data Fields, select Create a custom field, then select Data Type > Text (the Format will default to None).
List format guidelines for HTML data
Next, we will review your HTML list format requirements. In order for WordFly to fully import the HTML data from your list to the text data field in WordFly you will need to make sure your HTML format does not contain any breaking elements. Your HTML will also need to include any styles as inline styles.
Breaking elements include:
- Carriage returns
- Un-Escaped Quotes
- Wrapping the HTML in a <p> tag
Why do these elements break?
WordFly processes lists as CSV files (comma separated values). Simply put, a comma will separate columns of data in the list import. Other values such as tabs, carriage returns, and quotes act in the same way as a comma. For this reason, these values must be omitted from HTML as they can break the list import process by moving data into new columns.
Wrapping your HTML in a <p> tag isn't necessary because the data field in WordFly is by default wrapped in a <p> tag. When constructing your HTML, you'll want to be mindful of where it will be added within your HTML document. For instance, if your content is nested within a <p> tag, you will want to make sure that it will not be inserted within another <p> tag. Nesting <p> tags in HTML is actually classified as illegal!
Proper HTML formatting
Obviously, you will probably have carriage returns, commas and possibly quotes in your HTML. How can you avoid these breaking elements? The good news is you can usually keep these in the HTML. The easiest way to avoid breaking elements in HTML is to wrap the HTML in quotes. This ensures the carriage returns, commas and other separators are translated within the quotes and not separately.
Using a tool such as Notepad++ or VS Code to review your file before importing into WordFly is very helpful.
Red flags to look for include:
- Rows splitting at the HTML data. Rows should not split.
- Characters CR LF after a column of data, this indicates carriage returns.