Text loaded via API doubles line spacing.

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

I'm using an Access database with QuNect to read emails from an Exchange server, parse the information into fields, then push the data to QuickBase.  Everything works as intended, except the one field that holds the "Full Email Body" (i.e. everything in the email).  This field in QuickBase is a multi-line text field, but QuickBase doubles the line spacing in the text. 

So if the emails says:

Hi John,

How are you?

Thanks


It shows up in Quickbase as:

Hi John,


How are you?


Thanks

I think it has something to do with the emails having a CR+LF (carriage return + line feed) combo to specify a newline, and QuickBase probably interprets the CR as a newline then the LF as another newline.  Access displays the data correctly, but QuickBase doubles the spacing.

Anyone have any ideas or suggestions?

Photo of Ryan

Ryan

  • 88 Points 75 badge 2x thumb

Posted 3 years ago

  • 0
  • 1
Photo of Ammar

Ammar

  • 312 Points 250 badge 2x thumb
Hight light the text and inspect it with a right click and see what is quick base exactly adding. It might be that your email has a <br> tag to break the lines in the text and quickbase is appending those text to a paragraph html tag which has a top and bottom margin, thus the big space. 
Photo of Ryan

Ryan

  • 88 Points 75 badge 2x thumb
QuickBase appears to be doubling up the line breaks.  So when I inspect I see something like this:

First Name: Frank
<br></br>
<br></br>
Middle Name: N
<br></br>
<br></br>
Last Name: Stein
<br></br>
<br></br>

But the incoming email, when viewed in Outlook looks like this:
First Name: Frank
Middle Name: N
Last Name: Stein

I have tried stripping out some Chr(13) and Chr(10) from the inbound emails, but it doesn't help.  Once it gets into QuickBase, the line spacing is doubled up again.  

I have also tried saving the email as an HTML file to see if Outlook/Exchange has any weird characters, and I do see an extra <o:p></o:p> after each line.  I googled this and it turns out that Microsoft puts these tags into emails for some compatibility reasons with Word documents.  However, the "o:" is supposed to be something read by Microsoft products to indicate that the "p" tag is only to be used by an Office product.  In theory any other application would ignore the tag... but it appears that QuickBase is "seeing" it for some reason.

This isn't for all emails, just 2-3 senders that consistently have this issue.