Re: Create a custom field in Lead

juliamunkhzul
Level 2

Create a custom field in Lead

Hi, 
I need a custom field that holds longer texts (rich text) in Leads. I can create custom field of TextArea datatype but from API there is no such option. Is there any reason why? How can I create a custom field that holds long text through API?

9 REPLIES 9
SanfordWhiteman
Level 10 - Community Moderator

Re: Create a custom field in Lead

Can you please explain the surrounding business requirement for creating this field via the REST API?

juliamunkhzul
Level 2

Re: Create a custom field in Lead

I would like to create textArea custom field, which stores html email as a text/string. so that i can use it in the email template {{lead.customField}}

SanfordWhiteman
Level 10 - Community Moderator

Re: Create a custom field in Lead

Can you please explain the surrounding business requirement for creating this field via the REST API?

juliamunkhzul
Level 2

Re: Create a custom field in Lead

because i don't want to use UI

SanfordWhiteman
Level 10 - Community Moderator

Re: Create a custom field in Lead

Is this a one-time schema update? Are you writing a commercial app?
juliamunkhzul
Level 2

Re: Create a custom field in Lead

yes i am, it's not one time i would like to create lots of custom fields. 
is there any other way to do it? storing rich text then use it {{lead.field}} in email?

SanfordWhiteman
Level 10 - Community Moderator

Re: Create a custom field in Lead

Still don’t understand why you’re withholding details about your project. That’s not the best way to get help from the community.

 

At any rate, you can use a Marketo Custom Object. The CO schema can be managed using the API and TextArea fields are supported. They’re also a lot less intrusive as unlike Lead fields they can be deleted completely.

 

In general, we avoid hard-coding HTML in fields — including CO fields — because there’s almost always a better way to format data properly without wasting storage on presentation elements (tables, etc.). For example, storing data as pure JSON and then using Velocity to format it as a table.

 

 

juliamunkhzul
Level 2

Re: Create a custom field in Lead

I feel like i am expressing myself well. i am creating an app that send 10k different emails to 10k leads in one campaign/program. So i thought if i store html email as a custom field in leads, i can create one email template and inject it like {{lead.customField}}. 

SanfordWhiteman
Level 10 - Community Moderator

Re: Create a custom field in Lead

Use a Custom Object, as mentioned above.

You should still strive to keep as much raw HTML out of fields as possible. It's not only repetitive to output the same elements over and over, but at a pure technical level even a Textarea can only hold 32K characters. You want your fields to contain the dynamic (i.e. varying) part of your emails, not the static parts.