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.

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.

1 Like

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.

3 Likes

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.

4 Likes

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.

2 Likes

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

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

2 Likes

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.

5 Likes

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 :slight_smile: 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 :slight_smile:

EDIT: This is no more the case!

3 Likes

On my to-do list.

2 Likes

Ummm…

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

:rofl: 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? :thinking:

This is no more the case!

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.

3 Likes

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.

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

4 Likes