Clarification on differences between Text and Long Text

How many characters does the TEXT type hold?
How many characters does the LONGTEXT type hold?

Diving deeper didn’t give much info:

Text Types

  • Text : a single line of text.
  • LongText : one or more lines of text.
  • Name : the name of a person or place.
Solved Solved
0 19 4,390
1 ACCEPTED SOLUTION

Steve
Participant V

I don’t know that there are hard limits on the length of either. What are your intentions?

View solution in original post

19 REPLIES 19

Steve
Participant V

I don’t know that there are hard limits on the length of either. What are your intentions?

Just trying to learn AppSheet better. I figured there had to be a character limit, especially for the Text data type.

I’ve simply been choosing the type based one whether it ‘fit on one line’ on a phone screen. If not, I use Long Text. Pretty unscientific way to choose.

For me, it just comes down to whether I expect to need line breaks; if so, LongText. I can’t really say I’ve had too many large text values, though, so I haven’t really pushed any limits.

I’ve wondered about the point that @Lucinda_Mason brought up too.

I think this is really a documentation issue. See for example the following:

The title of the article indicates that it should be the proper place to start to learn about how “Text”, “Long text”, “Show”, etc. are different but, alas, no explanation – not even a link to an explanation. For the most part, I’ve learned about how column types actually work through trial and error and through discussions in this community. As AppSheet continues to grow and more and more people come to the platform expecting everything to be relatively easy and properly explained, I think this kind of documentation should be improved.

I agree about the documentation. I’m the type that use to sit out by the pool and read the 400 page manuals that came with software, like WordPerfect. I don’t know how many extra books I bought, and devoured, on Microsoft Access back when I was developing DBs in it.

Like Steve, the major difference to me is line breaks.

In particular, if you are wanting paginated reports in AppSheet, linebreaks can be problematic.

Thanks @Jonathon! I never tested it out, but does this mean that line breaks don’t work in with “Text” (as opposed to “Long text”)? Or, is it an issue that comes up in reports?

With longtext fields, users can enter as many line breaks as they want. These aren’t allowed in Text fields.

For a quick example, a user may want to write:

The inspection went well. Items of note are:
-The space was clean
-The staff were adequately trained

Client effort is commendable

For reports this can be troublesome. Take for example a ‘comments’ field - I have had users be very liberal with their use of linebreaks, which causes reports to have awkwardly large row heights for these records. Its visually unappealing. It also breaks my method of adding pagination, as row heights need some amount of consistency.

Thanks a lot! That makes sense. By the way, I just checked my own app and I have all of my columns where I want to be able to type in text set to “LongText”. Perhaps that’s why I didn’t notice a difference.

I have the same problem in my PDF reports. That’s why I use this expression to limit the user to enter max. 6 NewLines. It was once a Hint from @Aleksi in good old Google+ times saying:

Basically you could find all paragraph breaks if you split the string one by one. I’m saying this… find the first one and split it with the combination of LEFT and RIGHT expressions. When you have that 6 times, you should not able to find any more. If TRUE, the user has added too many.

FIND("
" , RIGHT([LongText] , LEN([LongText]) - FIND("
" , [LongText]) - FIND("
" , RIGHT([LongText] , LEN([LongText]) - FIND("
" , [LongText]))) - FIND("
" , RIGHT([LongText] , LEN([LongText]) - FIND("
" , [LongText]) - FIND("
" , RIGHT([LongText] , LEN([LongText]) - FIND("
" , [LongText]))))) - FIND("
" , RIGHT([LongText] , LEN([LongText]) - FIND("
" , [LongText]) - FIND("
" , RIGHT([LongText] , LEN([LongText]) - FIND("
" , [LongText]))) - FIND("
" , RIGHT([LongText] , LEN([LongText]) - FIND("
" , [LongText]) - FIND("
" , RIGHT([LongText] , LEN([LongText]) - FIND("
" , [LongText]))))))) - FIND("
" , RIGHT([LongText] , LEN([LongText]) - FIND("
" , [LongText]) - FIND("
" , RIGHT([LongText] , LEN([LongText]) - FIND("
" , [LongText]))) - FIND("
" , RIGHT([LongText] , LEN([LongText]) - FIND("
" , [LongText]) - FIND("
" , RIGHT([LongText] , LEN([LongText]) - FIND("
" , [LongText]))))) - FIND("
" , RIGHT([LongText] , LEN([LongText]) - FIND("
" , [LongText]) - FIND("
" , RIGHT([LongText] , LEN([LongText]) - FIND("
" , [LongText]))) - FIND("
" , RIGHT([LongText] , LEN([LongText]) - FIND("
" , [LongText]) - FIND("
" , RIGHT([LongText] , LEN([LongText]) - FIND("
" , [LongText]))))))))))) = 0 

But this is counting only the Lines Breaks. A user could enter loooooong text in just 1 Line and could break the limit.


By the way: When a user writes something like this:

"This is my first Line. After that I will press Enter
"

The Line Break at the end will be ignored by AppSheet. Good News

EDIT: This is no more the case!

Ummm…

(COUNT(SPLIT([LongText], "
")) > 6)

Thank you Steve. Back then I think we didn’t have the SPLIT() expression.
For sure your expression works like:

(COUNT(SPLIT([LongText], "
")) <= 6)

It’s always good to maintain old expressions.

Question: Why do you start and end with brackets?

I want my expressions to be fully contained, so that if dropped into a larger expression there’s no chance it will be interpreted differently due to order of operations or the like.

This is no more the case!

On my to-do list.

Thanks @Steve! Your documentation is great and I know you are busy. Thanks for all you do!

Hi Steve, I am wonder if there is any further details on this topic.  I historically perform as a best practice is to limit the datatype in DBs and naturally I have an inclination to only use 'LongText' when necessary (memory management of VARChar for example).   

The reason I raise this and looking for those that may know more, is I am connecting Data to Bigquery views.  When connected, it generates all datatypes of text to LongText.   

The conversion process to turn it to Text is an assumption I have based on working with most technologies allowing for better performance management due to backend index creations/automations.   

Do you know if this matters at all with Appsheets?  Am I wasting time converting each of these to a Text Type? 

I am slowly passing the 50 mill record mark, still very trivial for what I am use to, but I am unsure at what point this starts challenging Appsheets

Your contribution is appreciated.  

Austin
Participant V

I have found long text to be more of a nuisance when it comes to formulas(lookups and comparisons) than text so I never leave the defaulted long text in my tables to avoid this issue.

Rifad
Participant V

linebreaks never worked on table view anyway!

Top Labels in this Space