# Announcement: Enhanced Field Validation

**URL:** <https://community.hubspot.com/t/announcement-enhanced-field-validation/17429>\
**Category:** APIs & Integrations\
**Tags:** announcements\
**Created:** [November 26, 2019, 3:51pm UTC](https://community.hubspot.com/t/announcement-enhanced-field-validation/17429 "2019-11-26T15:51:31Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmclaren](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jmclaren/32/38449_2.png) [@jmclaren](https://community.hubspot.com/u/jmclaren)\
**Post date:** [November 26, 2019, 3:51pm UTC](https://community.hubspot.com/t/announcement-enhanced-field-validation/17429/1 "2019-11-26T15:51:31Z")

</div>

**EDIT:** This change has started to take effect. We’ll be rolling this out gradually over the next week  
**What’s Changing?**

HubSpot is changing how validation works on some commonly used fields for contacts, including the first and last name. This change will look for values that are obviously not valid values for the fields.

**Why are we making this change?**

This change should help HubSpot customers maintain a cleaner database by rejecting obviously wrong values from being added to properties. This change is also designed to help protect customers from attack. By restricting the values of commonly used fields, it makes it more difficult for attackers to inject potentially harmful values.

**What action is required?**

For the vast majority of developers, no action is required. However if you are using the default fields for a purpose other than their original intent, you should [create a custom property](https://knowledge.hubspot.com/contacts/manage-your-properties#create-custom-properties) to hold this information.

**When will this change take place?**

This change will take effect on February 26, 2020.

If you have any questions, join the discussion below.

---

<div class="post-metadata">

**Author:** ![MFrankJohnson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mfrankjohnson/32/22490_2.png) [@MFrankJohnson](https://community.hubspot.com/u/MFrankJohnson)\
**Post date:** [November 28, 2019, 9:40am UTC](https://community.hubspot.com/t/announcement-enhanced-field-validation/17429/2 "2019-11-28T09:40:58Z")

</div>

Any word on …

- Which properties will be impacted specifically?

- Examples of the new validation rules?

- What “_obviously wrong values_” might be rejected?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![jmclaren](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jmclaren/32/38449_2.png) [@jmclaren](https://community.hubspot.com/u/jmclaren)\
**Post date:** [December 1, 2019, 8:18pm UTC](https://community.hubspot.com/t/announcement-enhanced-field-validation/17429/3 "2019-12-01T20:18:24Z")

</div>

Hi Frank,

Good questions, affected fields/properties are standard HubSpot default fields.  
An example of both a validation rule and obviously wrong value, would be if you have a first name field and a URL or code was entered instead.

If you have been intentionally storing data this way we would advise using new custom properties rather than abusing the default properties.

---

<div class="post-metadata">

**Author:** ![TheresaB](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/theresab/32/84083_2.png) [@TheresaB](https://community.hubspot.com/u/TheresaB)\
**Post date:** [May 29, 2020, 1:00pm UTC](https://community.hubspot.com/t/announcement-enhanced-field-validation/17429/4 "2020-05-29T13:00:54Z")

</div>

I am having issues with one of my clients because prospects are not all including their area code when inputting a phone number. Is there any way for phone numbers to be validated?

---

<div class="post-metadata">

**Author:** ![jmclaren](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jmclaren/32/38449_2.png) [@jmclaren](https://community.hubspot.com/u/jmclaren)\
**Post date:** [May 23, 2022, 1:33pm UTC](https://community.hubspot.com/t/announcement-enhanced-field-validation/17429/5 "2022-05-23T13:33:08Z")

</div>

Hey there, understand the frustration. If you’re using the API and collecting the phone number yourself I recommend building your integration so that it requires the user to submit an area code.  
Client-side a helpful thing you can do is visually indicate to the user that the field is not complete when they leave off the area code. this can be done with the html `tel` input and CSS :invalid

> **[HTML attribute value - HTML | MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/tel)**
>
> elements of type tel are used to let the user enter and edit a telephone number. Unlike and , the input value is not automatically validated to a particular format before the form can be submitted, because formats for telephone numbers vary so much...

---

<div class="post-metadata">

**Author:** ![andreub](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@andreub](https://community.hubspot.com/u/andreub)\
**Post date:** [May 20, 2022, 2:40pm UTC](https://community.hubspot.com/t/announcement-enhanced-field-validation/17429/6 "2022-05-20T14:40:36Z")

</div>

Hi jmclaren,

would it be possible to obtain a description of the pattern or algortithm that determines the validity of values, so that we can know beforehand whether a value will be accepted by the API or not?

Cheers

---

<div class="post-metadata">

**Author:** ![jmclaren](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jmclaren/32/38449_2.png) [@jmclaren](https://community.hubspot.com/u/jmclaren)\
**Post date:** [May 23, 2022, 1:26pm UTC](https://community.hubspot.com/t/announcement-enhanced-field-validation/17429/7 "2022-05-23T13:26:41Z")

</div>

Unfortunately we can’t provide the pattern/code which is used to validate values.  
While understandable to want that as an integrator, we would them be also providing that information to spammers or bad actors defeating the purpose.  
What I can tell you is the validation is looking for obvious wrong answers. Without explicitly stating a real example. Imagine you have a number field, and someone submits letters. That would be an example of an obviously wrong answer.

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [May 23, 2022, 3:46pm UTC](https://community.hubspot.com/t/announcement-enhanced-field-validation/17429/8 "2022-05-23T15:46:21Z")

</div>

Thanks for the extra details @jmclaren 🙌 – Jaycee

---

<div class="post-metadata">

**Author:** ![adriano-azos](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@adriano-azos](https://community.hubspot.com/u/adriano-azos)\
**Post date:** [June 8, 2022, 3:39pm UTC](https://community.hubspot.com/t/announcement-enhanced-field-validation/17429/9 "2022-06-08T15:39:23Z")

</div>

Does this mean that if I set the pattern attribute on input by javascript, it does not work inside the HubSpot form?  
I’m trying a lot an input with a pattern that doesn’t work.

---

<div class="post-metadata">

**Author:** ![PCronin9](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/pcronin9/32/195519_2.png) [@PCronin9](https://community.hubspot.com/u/PCronin9)\
**Post date:** [June 27, 2022, 2:43am UTC](https://community.hubspot.com/t/announcement-enhanced-field-validation/17429/10 "2022-06-27T02:43:09Z")

</div>

I found this surprising; at least for our use case. Are any of the “obviously wrong” characteristics being checked for on the list of [falsehoods programmers believe about names](https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/)? From our perspective, if someone says their name just happens to also parse as a hostname, that’s fine, it’s not our business to tell them they can’t have that name. I guess using a custom property to replace HubSpot’s name field will work for our organization, but it’d be lovely if the things a text field called “name” won’t accept were at least described somewhere in the API docs so that a lot of trial an error on the part of many integrators could be saved.

---

<div class="post-metadata">

**Author:** ![AHazelton](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@AHazelton](https://community.hubspot.com/u/AHazelton)\
**Post date:** [July 12, 2022, 7:23pm UTC](https://community.hubspot.com/t/announcement-enhanced-field-validation/17429/11 "2022-07-12T19:23:35Z")

</div>

Is there a way to perform some validation prior to creating the contact so that the user can update the input prior to submitting the request? For our integration, the Hubspot contact creation happens later on in our workflow after our own validation is performed. Without providing any validation rules, we have no way of knowing if this step is going to be successful. Please either make this feature optional or provide some way of validating the input without creating the contact.

---

<div class="post-metadata">

**Author:** ![andreub](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@andreub](https://community.hubspot.com/u/andreub)\
**Post date:** [January 26, 2023, 12:14pm UTC](https://community.hubspot.com/t/announcement-enhanced-field-validation/17429/12 "2023-01-26T12:14:55Z")

</div>

This is aggravated by the fact that the error message is not easily parseable. If you update several contacts in batch and one of them contains an “obviously wrong” name, the error response will tell you which field was the offending one, but not of which contact. As far as we’ve seen, the only way to find exactly which name has a problem is to parse the error message, which used to say “\“foo.bar\” contains a URL”. Now the message changed to “foo.bar contains a URL” (note no quotes anymore) and that broke our workaround.

So, if the API is going to reject input following unpublished rules, it’d be nice if at least the rejection message follows a standard format so we can do _something_ about that.

---

<div class="post-metadata">

**Author:** ![davidwork7](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/davidwork7/32/48852_2.png) [@davidwork7](https://community.hubspot.com/u/davidwork7)\
**Post date:** [January 13, 2021, 2:53pm UTC](https://community.hubspot.com/t/announcement-enhanced-field-validation/17429/13 "2021-01-13T14:53:23Z")

</div>

Dr.ing  
D.Med  
D.med  
[Dr.me](http://Dr.me)  
Dr.med.

above all text when i add in Firstname all time API give error

Can you give list or format which conider as Invalid TEXT

how can we ideantify its not valid text ?
