Rich Text Formatting - in Preview Program

Amy
New Member

The following feature has been added to the Preview Program. Feel free to try out the feature and report issues or possible improvements in this thread.

AppSheet is expanding how text can be formatted. For data that is typed as LongText, app creators can now choose to render Markdown or HTML in Detail views.

Note: In all views other than Detail, the value will render as plain text.


How do app creators use the feature?

  1. Start with data that has HTML or Markdown inputs.

In this example, the Quote column contains HTML data and the Reviews column contains Markdown data.

  1. In the AppSheet editor, go to Data > Columns, expand the desired table, and set the Type field to LongText for the columns that you want to render Markdown or HTML in Detail views.

  1. Click 3X_d_b_db7eeece9e0c31e5e42cb2b4e5a591045ba56b63.png to modify the row, and set the Formatting field to HTML or Markdown (depending on your column data).

  1. Save your application. You should see the rendered text within the Detail view of your app.

How do app users use this feature?

Users can input HTML or Markdown in the appropriate fields.

What are the supported views?

Currently rich-formatted text will only be rendered in Detail views - all other views will display plain text.

What are the supported data types?

The column type must be set to LongText with the format set to HTML or Markdown.

What are the supported HTML tags?

<a>, <b>, <strong>, <i>, <u>, <em>, <mark>, <small>, <del>, <ins>, <sub>, <sup>, <p>, <li>, <ol>, <ul>, <br>, <hr>, <blockquote>, <img>, <h1>,<h2>,<h3>,<h4>,<h5>,<h6>, <table>, <tbody>,<tr>,<td>, <th>

  • Unsupported tags will be rendered as plain text.
  • Allowed attributes:
    for <a>: href, name, and target
    for <img>: src
  • All other attributes will be removed (for example, inline styles such as <p style="color:red;">A red paragraph.</p> will be removed and will not have any effect).

What are the supported Markdown elements?

Heading, bold, italic, blockquote, ordered list, unordered list, inline code, code block, horizontal rule, link and image.

Example: Using a virtual column

  1. Create a virtual column and set its column type to LongText and formatting to HTML.
  2. Edit the App Formula to use the CONCATENATE formula to combine HTML tags with column values.
  3. Save and view your app.

The resulting app:

Please let us know your feedback in this thread!

37 146 25.2K
  • UX
146 REPLIES 146

How’s it look on a phone screen?

Technically, table width will exceed the view width (mobile) then we should see the horizontal direction slider to move right and left, rather than “fit with”… Looks not good.

Có cách nào để căn giữa các cột không?

Google translate: Is there a way to center the columns?

I think centering would be done with “attributes” but that a centering attribute is not available. Here’s a quote from the original post:

Yes, no CSS is accepted for the moment to control the styling, inc. alignment of text or other objects unfortunately.

Without css,

<center>

tag is only available solution, but for the moment, this particualr html tag can not be used neither.

Hi @Amy

We tested and confirm img tag is working with the rich text feature, but the problem we observe is generally having the same problem as table tags.

The image size is not optimized and maintain original dimension which is not good. We wish to control the width of image regardless of the original image size is , for instance, to fit the detail view width also regarless of the device, mobile, desktop whatsoever.

Possibly the best solution is you set the image width to fix to the width by default.
Thank you.

I would like to second @Koichi_Tsuji 's request for automatic image resizing.  That would be fantastic. Otherwise, images are very difficult to use with HTML.

Me too. That would be very important, we have an app with training documentation, for the moment, the only solution we found is to automatically resize all images to 650px before having them upload. It is still not ideal, they look blurry on HD screen and not always fit the screen depending on the size of the device.

I have two reports to make. The first one is positive and the second is of a problem.

  1. List function works nicely in my app!

I had a part of my app that looked like this:

3X_9_e_9e3b3e81ce72e4052f051c3e56a9f6d5037df3bf.png

This is the Japanese side of a bilingual part of the app but the formatting issue is the same. As you can see, I wasn’t able to indent. Also, I had to be careful to keep each item short because text wrapping would make it look even worse. Now it looks like this:

3X_5_c_5cd21ee39bb27be5ab67c3429a65d40a8965151b.png

Yippee! Much better! The use of tags instead on actual line breaks also saves vertical space in my Google sheet. Lots of things to be happy about!

  1. Links in text not working on my iPhone

Here’s the code:

To use your <i>app</i> on a computer, open <a href="https://www.appsheet.com">AppSheet.com</a> in your browser,

I looks fine on all of my devices:

3X_8_7_879f7a82ea15b9e98f9efda0db2abd409d3d9a3d.png

And, it works properly on my computer and on a Android device. On my iPhone, however, I get this when I try to tap on the link:

P.S. All of this was done in physical columns, not virtual ones.

I’m coming back to this after a long time. Actually, I had forgotten that I had already tested the “a href” tag and had trouble with it so I wound up trying it again and found that it didn’t work properly. The link was to an ordinary web page. On my browser, I could open it if I right clicked on it but not by clicking on it normally. On my phone, my only option seems to be to copy the URL. Otherwise, it seems to try to open an AppSheet app in the browser.

If “a href” is to be allowed, I think it should work properly. Perhaps I should notify Support later.

Now the links seem to be working. 🙂

I was wondering why I hadn’t noticed this post earlier and now I know – there’s a problem with the “What’s New” section of the community website:

3X_7_d_7d9ea6a16cd921929aadc4de2fa1391c49aba4df.gif

“MySQL - Support” has been at the top in the “Latest” category for a while now but the original post was 16 days ago and the last comment was 4 days ago. This post is newer by any measure and, in fact, if one clicks on the orange “Announcements” link, one gets this:

I’m glad to know the workaround but one shouldn’t have to know a special trick to find the latest information. I hope someone can fix this.

P.S. Thanks to @tsuji_koichi for telling me about this new feature in another thread. Otherwise, it might have taken me even longer to find it, even though I made a point of checking “What’s New” from time to time.

Clicking there is equivalent to searching with this:

#announcements tags:new

It depends on the “new” tag. I’d agree that that is not optimal, but “something wrong with it” is not really correct. I’d advise just clicking on the Announcement category directly (or any category), and it should default to being sorted by latest.

Thanks @Marc_Dillon ! This is helpful. I looked at the URL and see that the tag you indicated is there. So, I’d like to request that @Amy add the “new” tag to this post and that other announcements get the “new” tag when they are first posted as well. Otherwise, I think that others will get the impression that there are no “new” announcements to read when there really are.

As much as I want the ability to create rich text, this is not the way to go - in my opinion. My users will never enter html or markdown symbols to create formatted text.

They need to ability to have basic rich text editing features on long text fields.

What will happen to data created using html or markdown language when we eventually get the rich text editing feature. Or is true rich text not in the plans?

Bài viết này rất hay, tôi có 1 câu hỏi, tôi có 1 cột kiểu dữ liệu longtex, và muốn dùng html để show 1 bảng từ dữ liệu của 2 bảng khác thì làm như thế nào?

Google translate: This article is very good, I have 1 question, I have 1 column of data type longtex, and want to use html to show 1 table from data of 2 other tables, how to do?

Unfortunately, I’m not aware of any method for importing data from other tables using html.

Post #22 above shows the html syntax for creating a table with 2 columns. Will that help?

This rich text formatting feature is a big step forward for me. Thanks again!

I’d like to point out one tiny way in which the editor interface might be improved to prevent creators from wasting time with mistakes. Currently, it’s possible to choose “HTML” even though the column type is not “long text”:

If “Markdown” and “HTML” could be greyed out when the file type is not long text, that would prevent careless errors of the sort I just made myself.

By the way, I hope rich text formatting will definitely become a permanent part of the platform. If not, it’s going to take me a while to undo all of the html I have added.

If it’s well formatted can make a complete print from detail view to print

I use Onboarding views for Instructions. It would be great to have Rich Text in that view.

I tested target atributes like this but it did not work as expected.

> <a href='https://www.google.com' target='_self'>Link</a>

_self should open the target page on the same tab, but actually it opens new tab for the moment.

Is there a way to open something similar to linktorow or linktoform using this inside the app itself ? Any help would be appreciated @Koichi_Tsuji 

@Amy If you could also include strikethrough, that would be helpful for rendering lists with stuff complete.

Hello. In Map Detail View don’t work. The longtext display the html tags inside text.

Thank you very much @Amy for this new feature.
In our App we receive error messages sent from heating systems. They come by e-mail and often are in html format. Like “To see the status of the heating system click here”.
Before, we connected the emails with Zapier to our AppSheet App. But the message came as plain text and any “click here” was not clickable.
Now we can send html text to our AppSheet App and the user can see the email as it looks in outlook.
That’s very cool.
By the way: Now we use Integromat instead of Zapier.

Since E-Mails also have a header, I had to remove the header via RegEx to only get the body:
<body[^>]*>((.|[\n\r])*)<\/body>

If not, the message would start like this in AppSheet:

<html>
<head>
<meta />
</head>
<body>

Maybe you could remove the header automatically?

I also had to remove tags like these via RegEx:
<script[^>]*>((.|[\n\r])*?)<\/script>|<\/?div.*?>|<\/?label.*?>|<\/?span.*?>

How did you get your form field to be multiple lines? Is that part of the preview?

3X_4_a_4acc5e83df83d6341641c31bef993d8f748a2c69.png

LongText is displayed that way.
You can even have a new line just by hitting Enter/Return

@Amy @Arthur_Rallu
Markdown and HTML is working in a detail view.
3X_e_4_e453683011990422aa09fe93c6bd72dd95f53194.png

But not in a map’s detail view.
3X_0_6_06f8603451b1077a7d4a287a4dbb43cad620f7d6.png

Thanks for letting us know - I’ll file a bug for this!

@Amy @Arthur_Rallu This bug still exists after 1 year. Any hope that this will be resolved?

Hi @Fabian_Weller 
It's not forgotten, but the team was and is prioritizing desktop UI. At the moment, I can't say when they'll be able to get to that particular bug. 

April 2023 and is still here 😕

That’s what I figured

  • Thanks for letting us know!

Any update on this going to full release?

Again, I’m very happy to have rich text formatting capabilities. I’ve been playing around with them recently and have one more observation to make.

In Deck view, the tags are not rendered but not hidden either:

 

 

In Detail view, all is well:

3X_1_5_158dd9d71186079aec14cc367402407ff35db3b7.png

So, since I can imagine that rendering the tags in Deck view may not be possible, I wonder if the app could automatically hide such tags.

You could use two VC for that as a workaround for now. Using CONTEXT() you could change between two labels using like the [HTMLLabel] for Detail Views and [StandardLabel] for anything else.
Standard could be the same as HTML but removing tags using SUBSTITUTE()
I doubt AppSheet will come up with an official solution.

PS: If the column is not label, is the same thing

Thanks! Your solution makes sense.

I guess this is what made me think that I could expect tags to be ignored:

But, now that I’ve tested it out, I see that this means that the tags will be visible as plain text – not hidden.

It would be cool if there were a simple way to get rid of all HTML tags but the only way I can imagine doing it with SUBSTITUTE() would be very complicated if I wanted to make it comprehensive. I wonder if there’s an HTML stripper like the following that can be accessed within AppSheet:

@Amy the Onboarding view would be a great place for this to work as well

  • At least inside the Short_Blurb 2 field - the more “body text” looking of the three.

This would be very handy!