When I started working on Sitecore Forms, the very first thing that surprised me is that Sitecore doesn’t provide an Rich Text (HTML Raw) field OOTB. It do provides a Text field which can help us in providing the context about the forms.
But…In certain situations, we might need some Rich Texts to be included in the form like an Anchor Tag or some other HTML Elements that is not just texts.
These scenarios can however be handled in several ways, like adding a separate rendering that can in turn call the System->MVC Form using it’s ID and then passing on the data source to it and then adding the required Rich Text Contents Statically in the Rendering.
<HTML Elements></HTML Elements>
@Html.Sitecore().Rendering(“System->MVC Form Rendering ID”, new { DataSource = “The Concerned Form (Data Source) ID”})
<HTML Elements></HTML Elements>
But this can’t help at all times and it doesn’t make the form customizable down the lane. It allows you only to add the html elements by the beginning/end of the forms.
However, just like every other components in Sitecore, Even in Sitecore Forms you can add custom fields. In fact they have provided a decent documentation on how this can be done here. The article provides a better view on the steps to be followed for creating Custom Form Elements. It is for creating a Video Element.
Making use of it, creating a Custom Form Element – Rich Text Field thought I could share some of my experience here.
Step 1: Create a Rich Text Template with a field of Rich Text type. Remember to create the Custom Field in the path /sitecore/templates/System/Forms/Fields/Custom Fields/Rich Text based on the /sitecore/templates/System/Forms/Fields/Field template or create one using System template and inherit Field, Label Settings
- Now, we have to create the standard template. The Standard Value will be referred when loading the custom element to the form (Dragging/Dropping) hence it is important to add them. Else, we will be facing issues while loading the elements to the form.
![In heritance
Fields
Custom Fields
g.] Rich Text
Button
Checkbox
Date
Dropdown List
Email
Email Confirrnation
Field
File Upload
List
Builder
Data
Content
Rich Text
Add a new field
Add a new section
Rich Text
Single-Line Text](https://pushpaganan.home.blog/wp-content/uploads/2020/02/image-24.png?w=1024)

Step 2: Create a Model/View for the Custom Form Element.
- Model to be inherited from Sitecore.ExperienceForms.Mvc.Models.Fields.FieldViewModel so that we can override InitItemProperties and UpdateItemFields, where we will set and update the field value when we create and update Field in Form Editor or Under Sitecore/Forms in Content Editor.
![_MvcOuterLayout.cshtml
_TwoColumnCategoryLayoutcshtml
Sitecore. Data . Items;
Si tecor•e
. Data . Fields;
System;
S i tecore ;
Sitecore. Di agnostics ;
_MainLayout.cshtml
RichText.cshtml
Guardian
11
18
20
26
Mark3.Websites.Guardian.Fields.RichTe
using
using
u s ing
u51ng
using
namespace mark3.kbsites.Guardian. Fields
[Serializable]
public class RichText : FieldVi+&deI
public string RichTextFieId
get;
g:
O
O
protected override void item)
Assert.
base. Initltempr•operties (i tan) ;
s.RichTextFieId = StringUtiI.GetString(item. Text"] -Value);
protected override void item)
Assert.
th)sc item) ;
item. Text"]?. SetVaIue(RichTextFieId,
true) ;](https://pushpaganan.home.blog/wp-content/uploads/2020/02/image-23.png?w=911)
- Now we will create a View that renders this Custom Field Value in the Form while rendering it the browser. Key point to note is, Sitecore has the Form Field’s Views under Views/FormBuilder/FieldTemplates/. It is best to keep the Custom Form Elements View here as well. Create a similar folder structure in the Visual Studio Solution and add the view there.


Since, we have nothing much to add to the Rich Text like tracking or styling or validating we can leave it here as it is.
Step 3: Creating Form Section Elements in Core Database.
These steps are just to show the way to add the sections and other styling/validation details in the Form Editor. It can be extended based on the custom field’s requirement.
- Create a item for Rich Text based on the template “/sitecore/client/Business Component Library/version 2/Layouts/Renderings/Forms/Form/Form Parameters ” under “/sitecore/client/Applications/FormsBuilder/Components/Layouts/PropertyGridForm/PageSettings/Settings/” name it “Rich Text”
![DatePicker
DropDownList
EmailConfirmation
FileUpload
List80x
MultiLineText
Number
Page
Password
PasswordConfirmation
RadioList
RichText
Sect on
RichText
Quick Info
Item ID:
Item name:
Item path:
Template:
Created from:
Item owner:
(11959687-78A&48F+90A8-295877658E08}
RichText
/sitecore/client/AppIications/Formsauilder/ComponentsJLayoutsJProperWGridForm/PageSettings/Settings/RichText
/sitecore/clierwausiness component Library/version 2JLayouts/Renderings/Forms/Form/Form Parameters - {72E58860-AC29-47E1-A1 C5-8F9E492DB999}
(unknown]
sitecore\Admin](https://pushpaganan.home.blog/wp-content/uploads/2020/02/image-26.png?w=1024)
- One key point to be noted here is we won’t be able to insert the item via Insert-> Insert from Template. As the Insert Options for the parent item – Property Editor Settings is configured in such a way 😦 So, you can either copy the other items like Text and alter as per our requirement or you can use Sitecore Rocks and do the changes.
- Under Rich Text create a item based on the template /sitecore/client/Applications/FormsBuilder/Common/Templates/FormSection and name it Details. Or you can copy the details item from Text (/sitecore/client/Applications/FormsBuilder/Components/Layouts/PropertyGridForm/PageSettings/Settings/Text)
- Under Details add an item Rich Text based on the template /sitecore/client/Business Component Library/version 2/Layouts/Renderings/Forms/Form/Templates/FormTextBox Parameters. (Although this is not required for now, just add the FormLabel element and update the RenderingitemId with the below values.
![N umber
page
Password
passwordConfirmatio n
RadioList
RichText
Details
Rich Text
Section
SingleLineText
Text
Stylesheet
Item ID:
Item name:
Item path:
Template:
Created from:
Item owner:
Appearance
(F661E544-8E50-4346-A744-BEC7B296D7DD)
Rich Text
/sitecore/clienb'Applications/Formsauilder/ComponentsJLayoutsJPropertyGridForm/PageSettings/Settings/RichText/Details/Rich Text
/sitecore/client/ausiness Component Library/version 2/Layouts/Renderings/Forms/Form'Templates/FormTextBox Parameters •
[u n known]
sitecore\admin
IsEnabled Specifies if the control is enabled (shared, standard value)](https://pushpaganan.home.blog/wp-content/uploads/2020/02/image-28.png?w=1024)
- Now, add the created Rich Text in the Details item – ControlDefintions and update the Configurationsitem.
![EmailConfirmation
FileUpload
ListBox
MultiLineText
Number
Page
P assword
PasswordConfirmation
RadioLi5t
RichText
Details
Rich Text
Section
SingleLineText
Text
Stylesheet
Item path:
Template:
Created from:
Item owner:
/sitecore/clienüApplications/Forms3uilder/ComponenWLayouts/PropertyGridForm/PageSettings/Settings/RichText/DetaiIs
/sitecore/client/Applications/Formsauilder/Common/Templates/FormSection • {F698FE6D-3SCA-4783-B36C-34928F3A23F2}
[unknown]
[u n k nown]
Configurationltem [shared]:
sitecor ent/Applications/FormsBu ilder/Components/Layouts/PropertyGridForm/PageSettings/Common/Sections/Deta IsExpander
ControlDefinitions - For each control item ID, a control Will be created. use vertical bar (l) for multiple IDs [shared]:
Edit
FieldName
Rich Text](https://pushpaganan.home.blog/wp-content/uploads/2020/02/image-29.png?w=1024)
Step 4: Now the final act, piecing things together,
- Create an item of type, /sitecore/templates/System/Forms/Field Type under /sitecore/system/Settings/Forms/Field Types/Basic so that this field type is displayed under Basic Section of the Field types in the Form Editor.

- Fill in the fields with the values, provide the View Path (Path of our .cshtml file created for rendering the field) , the Model Type – the Rich Text Model Namespace and Assembly.
- In the Property Editor select the one which we created.

- Finally, update the Template – Rich Text which we created first in the Field Template field.

All Set now and when we open the Form Editor include the Rich Text to the Form,

Finally, when rendered,

Ignore the poor choice of use case for the custom field.
NOTE:
- We wouldn’t be able to show the Rich Text Field in the Form Editor section as of now. This is because, if we have to do so, we have to create a FormRichTextBox Parameter template/item and include corresponding rendering and relevant items. Which will allow us to add/edit the rich text content in the Data Section of the Field in the Form Editor Screen.
- I would have written in a way to add the Data Section here and the binding details for rich text which don’t use. I added them so that it will be considered while developing custom fields that actually requires such sections.
- Now, to the point, we can edit this Rich Text Field via Content Editor. Access the forms under Sitecore/Forms/

Update:
- You can fix the issue (Not being able to update the field value in form designer screen) by updating the custom field model property in core DB- Property Editor Setting – Binding Configuration to camelCase as below











![Insert Rules
Analytics
Buckets
Content Testing
Email
Feature
Forms
Foundation
Layouts
Project
Rules
Security
Services
O API Keys
Aikido
Throttle Strategies
Simulators
Subitems Sorting
Validation Rules
workflow
Item ID:
Item path:
Template:
Created from:
{IAC63E4A.0879-4C09.A48E.7A5F2%91S39
/sitecore/systemJSetting:JServices/API KeysIAikido
/sitecore/temp1atesjsystemßemces/API Key - (A686806sD612-401 F-A40A-CDSBA0857B81)
[unknown)
sitecoreudmin
CORS origins [shared):
Allowed Controllers [shared]:
Impersonation user - Anonymous users will be impersonated as this user [sharedJ:
extra us](https://pushpaganan.home.blog/wp-content/uploads/2020/02/image-10.png?w=1024)
![1 AC63E4A-0879-4C09-A48E-7A5F2969153 F)
pageEd*ing: true.
• user: {
: "Admin"
: "website"
page-State :
"edit".
language : "
rout e : {
- fields: {
Text : {
"kp a single connected platform that also integrates with other platforms, to a single view of the customer in a big data marl
cmplexity that has previously held marketers back, the latest version of Sitecore makes customer experience highly achievable. Learn how the latest version of Sitecore gives marke-
capabilities to CuStCyrerS throughout an lifecycle – the technology foundation absolutely necessary to win CuStmerS for further
Documentation site" 'Sitecore Documentation " ,
editable:
"(input id-•fld 1180559FDEA542EA9CIC8A50F7E7eEF9 926' class-'scFie1dVa1ue•
type—'hidden•
with other custorner-facing platforms, to a single view of the custortær in a big data marketing repository, to completely eliminating much of the complexity that has previously held
experience highly achievable. Learn how the latest version of Sitecore gives marketers the complete data, integrated tools, and automation capabilities to engage customers throughol
foundation absolutely necessary to win CuStCmerS for further information, please go to the
Documentation "
Text" , "icon" " /temp/iconcache/office/16x16/penciI. png" , "disabledlcon" : "/temp/penciI_disabIed16x16.png" , "i5Divider" :fa15e, "tooltip" "Edit the text", "type" :null), {"click" : "chrome:fie:
value : tr•ue}) " "header" : "icon" : " / terp/iconcache/office/16x16/font_s tyle_bold. png" , "di sabledlcon" " / sabled16x16. png" , "åsDivåder" fal se , "tooltip" : "Bold" , "typ
userlnterface:true, value: true))" , "header" :
" • " . png" , "di sabledlcon" : png" , "isDivider" : f'
Icon .
value : true}) " , "header" : " icon" : " , " disabledlcon" : png" " : fal se "tooltip" : "I
click" : "chrome: field : insertexternall ink" , "header" , "i con" : " 'temp/ iconcache/office/16x16/earth_Iink.png" , " : png" , " i5Divider" : fal se,
" , type" -'null}, {"Click" : insert link ,
field. "
" "header
" " " , "Icon" . png" , • 'disabled Icon": : false,
{"click": "chrome: field: removelink", "header :
" • " 'temp/ iconcache/office/16x16/Iink_broken.png" , " disabledlcon" : "'temp/ I .png" , "i sDivider" : false, "tooltip'
"icon .
; field ; "header"; "Insert image % :
field. "
type" : "chrune:cotmon , "header"
: "Edit the "elated
item" , "icon" : "/temp/iconcache/office/16x16/cube5 .png" , "disabledlcon" : "/tenp/cube5_disabIed16x16.png", "i5Divider" :fa15e, "tooltip" : "Edit the related item in the Content Editor. " , "typ
{"click
" "header" :
" " icon" : " " , ' 'di sabledlcon" : " / temp/ users.
or edit personalization for this component. "type"
"header" : "Edit
variations", "icon" ; png" ; ; false, "tooltip" ; "Edit the variations " "type" ; "Sticky"} ] , '
, "custom" enter text of the item here. text" te
5tyIe-"Iine-height: 22px; ">From a single connected plat-
platforms, to a Single Of the Customer in a big data marketing repository, to eliminating much Of the that has previously held marketers back, the latest
I earn latest data. am' ramhilities
whi evahlp_
itønativø li-](https://pushpaganan.home.blog/wp-content/uploads/2020/02/image-15.png?w=1024)
![D: setup
Found existing D: The existing config will become defaults in this setup session.
Path to the Sitecore folder
Sitecore hostname Chttp://aikido.dev.local]: http://aikido.dev.local
Sitecore import service URL Chttp://aikido.dev.local/sitecore/api/jss/import]:
Sitecore API Key [{1AC63E4A-0879-acø9-A48E-7A5F2969153F}]:
Please enter your deployment secret [w1f4gt77wv7wuh8h8ch6mvk1un8iz21nnhiae8qp8ko] :
Deploy secret Sitecore config written to D:
Ensure this configuration is deployed to Sitecore.
JSS connection settings saved to D:
NEXT STEPS
* Ensure the hostname in /sitecore/confie/* -config is configured as aikido.dev_ local,
* Deploy your configuration (i.e. •jss deploy config')
* Deploy your app (i.e.
•jss deploy app -c
* Test your app in integrated mode by visiting http://aikido_dev. local
D: deploy config
Creating nonexistant destination path c:\inetpub\wwwroot\scq3sc_dev _
Copying _/sitecore/confie to c: \
JSS app build artifacts have been deployed to Sitecore-
and in hosts file if needed.](https://pushpaganan.home.blog/wp-content/uploads/2020/02/image-9.png?w=1024)
![server. bundle. js 1.26 MiB
ø
[emitted] main
Entrypoint main server-bundle.js
./src/temp/config.js 481 bytes {O) [built]
[13]
[14]
[16]
[20]
[23]
[35]
[53]
[55]
[96]
[106]
[167]
[168]
external
external
external
external
external
external
external
"stream" 42 bytes {G} [built]
"url" 42 bytes {Ø} [built]
"buffer" 42 bytes {G} [built)
"http" 42 bytes {0} [built]
"https" 42 bytes {e} [built]
"util" 42 bytes {0} [built]
"zlib" 42 bytes {0} [built]
./build/index. html 2.26 KiB {e} [built]
./src/temp/GraphQLFragmentTypes.json 4.68 Kid {O} [built]
./src/assets/sc_logo.svg 18 KiB {e} [built)
. /node_modules/encoding/lib sync 16ø bytes {ø} [optional] [built]
(webpack)/buildin/harmony-module.js 573 bytes {e) [built]
./src/assets/app .css 360 bytes {e) [built]
./server/server.js 117 modules 622 Kia {e} [built]
./server/server.js 7.39 Kia [built]
./src/1ib/GraphQLC1ientFactory.js 2.02 KiB [built]
./src/i18n.js 2.56 KiB [built]
./src/RouteHand1er.js 1ø.5 KiB [built]
./src/AppRoot.js 1.94 KiB [built]
./server/htm1Temp1ateFactory. js 3ø8 bytes [built]
./src/dataFetcher.js 703 bytes [built]
./src/temp/componentFactory.js 4.12 KiB [built]
./src/1ib/SitecoreContextFactory.js 6e2 bytes [built]
./src/Layout.js 2.76 KiB [built]
./src/NotFound.js 1010 bytes [built]
./src/1ib/GraphQLData.js 6.66 Kia [built]
106 hidden modules
154 hidden modules
WARNING in ./node_modules/encoding/lib/iconv-loader . js 9:12-34
Critical dependency: the request of a dependency is an expression
@ ./node_modules/encoding/lib/encoding.js
@ ./node_modules/node-fetch/lib/body .js
@ ./node_modules/node-fetch/index.js
@ ./node_modules/isomorphic-fetch/fetch-npm-node.js
@ ./src/1ib/GraphQLC1ientFactory.js
@ ./server/server. js
Creating nonexistant destination path c: \inetpub\wwwroot\sc93sc.dev.local\dist\aikido.
Copying D: to
'SS app build artifacts have been deployed to Sitecore.
D: \Repos i](https://pushpaganan.home.blog/wp-content/uploads/2020/02/image-12.png?w=862)
![HOME
Change
NAVIGATE
Publish
ANALYZE
VERSIONS
PUBLISH
Experience Editor Publishing viewer
Preview
CONFIGURE
PRESENTATION
SECURITY
VIEW
MY TOOLBAR
search
sitecore
, content
h€rne
aikido
Dictionary
Cornponents
O content
home
Page n
G Aikido-page-title-I
G ContentBlock-2
graphql
styleguide
Forms
Layout
Media Library
System
Templates
Aikido-page-title-I
- [home-jss-main-Aikido-page-title-1]
Quick Info
Item ID:
Item name:
Item path:
Template:
Created from:
heading:
D2F-SE89-A7S5-D134DF53436F)
home-jss-main-Ajkidt»page-titIe-1 - Display Name: Aikido-page-title-I
/sitecore/contenvaikido/home/Page Components/home-jss.main.Aikido-page.titIe-1
'sitecore/temp1ates/Projecvaikido,'Aikido-page.tit1e {988FD227-3165-5436-AC09-A23769E2A75C)
[unknown]
sitecoreysslmport
welcome To Dojo!!!](https://pushpaganan.home.blog/wp-content/uploads/2020/02/image-13.png?w=1024)
![system
Aliases
Dictionary
Field types
Analytics
Simple Types
List Types
Checklist
Droplist
Grouped Droplink
Grouped Droplist
Lookup Name Lookup Value
G Multilist
Multilist with Search
G MultilistDisp1ayTitle
Multiroot Treelist
Name Lookup Value List
Name Value List
Item path:
Template:
Created from:
Item owner:
'sitecoreJsystern/FieId types/ List Types/MuItiIist
,'sitecoreJtemp1ates/SFtemrremplatesrremplate field type - 17D6A-11
[unknown)
sitecor&dmin
Assembly ghared):
Class [shared]:
content:MuItiIistEx](https://pushpaganan.home.blog/wp-content/uploads/2020/01/image-15.png?w=1024)








![Email
Federated Experience Manager
Federated Experience Manager -
Federated Experience Manager -
fields
HttpRequest Parameter
O Check Parameter
Tags
'vtsibility
Indexing & Search
Insert Options
Item Attributes
Item Hierarchy
Item Information
Item security
Item Version
Item Version CM
Marketing Automation
Item path:
Template:
Created from:
Item owner:
Check Parameter
Isitecore/systemJSettingsJRuIes}DefinitionsJEIements/HttpRequest Parameter/Check Parameter
(unknown]
sitecore%Admin
mere the http request [ParameterName„.name] parameter (Operatorld. Stringoperator„compares to] [Value„.specific value]
Type [snared]:
Mark3 Websites. Guardian. CustomRules. HttpRequestParameterValueCheck.Ma rk3 .Websites. Guardian](https://pushpaganan.home.blog/wp-content/uploads/2020/01/image-10.png?w=1024)





























![Workflows
Analytics Test
Analytics Wor
Guardian Nev
Approved
Awaiting A
Draft
path Analyzer
Sample Work
Experience Ar
Templates
:ontent Editor
Media Li
X
Insert
Search
Duplicate
Delete
Rename
Copying
Sorting
Experience Editor
Publish Item
Console
Refresh
from:
mer:
State
Insert from template
Guardian News Article
'site core/system/Workf
/sitecore/templates/Sys
[unknown]
sitecore\Admin](https://pushpaganan.home.blog/wp-content/uploads/2019/12/image-12.png?w=649)

![Toolbox
Workflows
Analytics Testing Workfloi
Analytics Workflow
Guardian News Article
Approved
Auto Publish
Awaiting Approval
Draft
Path Analyzer Maps
Data
Type string (shared]:
Sitecore.Workflows.Simple.PublishAction, Sitecore.Kernel
Parameters [shared]:
deep- 1 &related-l
Advanced](https://pushpaganan.home.blog/wp-content/uploads/2019/12/image-5.png?w=989)


![Languages
List
Publishing
Settings
Analytics Testing Workflow
Workflow
ELÆrdian News Amcle
D raft
Swbt"it
Maps
% mple
Experience Analytics Segrnent
pushpaganan@hotmail.com
From
Subject [shared]:
Reg: Approval Require-S
Item Path SitemP8th
Lansu.ge Sit«nLan84e
lt.-n Version
Item URL Si:emurl
Mail server Ish'redJ:
Type
i](https://pushpaganan.home.blog/wp-content/uploads/2019/12/image-8.png?w=1024)
![gnaR5pace Mitecore.Fotmdation. Guardian
public class
public void args)
Assert. ArguentNotNu11(args, -args- ) ;
Processorltem processorltem — args.processorltem;
if (processorltem! -null)
Item inneritem =
String =
string To —
string Subject —
string MailBody -
string rpst — Servar•"];
var hail =
mail. Subject Subject;
mail. Body — mailBody;
"Message" ,
SmtpCIient smtp - 587);
smtp.EnabIeSsI — true;
smtp.UseDefauItCredentåaIs = false;
new
smtp.CredentiaIs =
smtp. ;
inner it&) ;
"password " ) ;
public string dataitem, string Field, Item actionltem)
string — actionltem[FieId];
Message - Message.
message - Message. datait&. Language. Tostring());
message - Message. dataiten.Version.ToString());
= dataitem.paths. FullPath);
retur•n Message;](https://pushpaganan.home.blog/wp-content/uploads/2019/12/image-9.png?w=885)
![Guardian
G Home
404
500
Around the World
Article Page
Business
India Today
Technology
Sports
Workflow
Workflow [shared]:
Workflows/Guardian News Article
Workflows/Guardian News Article/Draft
Lock:](https://pushpaganan.home.blog/wp-content/uploads/2019/12/image-4.png?w=1024)





























![Content Editor
Applications
Context Menues
Default
Insert
Search
Compress
Divider 3
cut
Copy
Paste
Divider 2
Duplicate
Delete
Rename
Divider I
Copying
Compress
Quick Info
Item ID:
Item name:
Item path:
Template:
Created from:
Item owner:
Action [shared):
{091 CSS02-8997-4E3F-94F&609500E051 B9)
Compress
/sitecore/contentJApplications/Content Editor/Context Menues}Default/Compress
/sitecore/tempIates/System/MenusJMenu item (998B965E6AB84568-810F8101 D60DOCC3}
[unknown]
sitecore\Admin](https://pushpaganan.home.blog/wp-content/uploads/2019/11/compress-menu-item.png?w=1024)
![Display name [unvers.onedl:
Compress
Hotkey LunversionedJ:
Icon (shared]:
Open icon
ID [shared]:
Clear
Message [shared):](https://pushpaganan.home.blog/wp-content/uploads/2019/11/menu-item-field-values.png?w=697)





