Is there a way to limit the number of characters displayed in a text fiels and reveal the full contents when the row is expanded.
Yes there is a way! if in a table i would use a button that change the value of a checkbox that is read by a formula in the original text value.
The new text (or the long one to say) is stored in another column and read at need, and the short preview of the text can be calculated with a formula that cut the text
A similar button/formula setup can be done also in the canvas
The easiest way that comes to mind is as follows:
- Text field (column) “FullText” is the full text.
- Column “ShortText” is a
formulacolumn with the formula:
Now just hide “FullText” on your table view.
This simply uses the ‘Left’ function to display the first “X” characters of the “FullText” field. https://coda.io/formulas#Left
In this example I chose “25” but you can choose however many chars you want.
I then appended “…” just to make it visually understood there is more text.
LMK if this doesn’t make sense and I can share a Doc.
Thanks for the replies but I wanted to know if there was a way without a fudge of having another column. But I guess there isn’t.
Ongoing with the elegant solution of @Shane_Robinson, you can put this in a button to expand the full text when pushing it and you are able to make a very user-friendly interface if you like so to do.
The nice part is that the buttons become self explanatory and you will be able to save a lot of space, remain focus on the subject and make it attractive to interact with your audience.
@Jean_Pierre_Traets how are you building the URL in the button and attaching the “modal” option?
When I copy your Doc, the URL in the button links back to your original Doc.
Correct. You can’t simultaneously display and not display the values in a column.
Think of the “ShortText” column as a variable to which you attach a ‘truncate’ filter for display.
I just noticed that my sample isn’t right, but I am in a hurry and can’t fix it now.
The solution in in this post:
Later on I will update mine too
Awesome! I’ll check it out.