Question:
What must I do to successfully store html in a rich content field from velo?
Product:
Wix Editor and Velo
What are you trying to achieve:
I have a rich content element in my collection/dataset. On save of a record in my application, I want to save a formatted version of the attributes to the rich content field. This formatted field will be used on a different page that is used on mobile devices to view the data (much more smoothly than the discrete fields).
What have you already tried:
Note: I originally tries just storing the html but it did not work. The Wix support AI suggeste the following code.
“const richContent = {“type”: “richText”,“html”: fmtRichDMOG};” where fmtRichDMOG is formatted html (shown below in the output).
I used the richContent in my dataset update and successfully stored the text.
This is what got stored in my rich content field. NOTE: I replaced all of the “<>” characters with “” so that the html would not be executed in this post. It is proper html in my data.
{
“type”: “richText”,
“html”: “PROJECT DEMOGRAPHIC[br]House #: 370[br]Project Code: 370-1051[br]Project Name: Lease/Agreement Approval[br]Project Type: Lease Approval[br]Project Status: In Progress[br]Lease Start Date: 1[br]Lease End Date: 2025.06.10[br][br]Project Created: 2025.05.30 16:30[br]Last Updated: 2025.06.10 13:30[br]This project IS NOT in response to a violation letter from the Board.[br]------------------------------[br]PROJECT DESCRIPTION[br][p]Description Test[/p][p]Test again[/p][p]Third time is the charm??[/p][br]------------------------------”
}
It does not display on the page. When I go to my collection in CMS, it shows an error and offers to convert it for me.
Just to clarify, I am trying to do this using velo code.
I’m sure that I am missing something simple, any assistance is appreciated.