# Changing field type - unexpected behaviour

**URL:** <https://community.prismic.io/t/changing-field-type-unexpected-behaviour/9900>\
**Category:** Developing with Prismic\
**Created:** [April 28, 2022, 10:40am UTC](https://community.prismic.io/t/changing-field-type-unexpected-behaviour/9900 "2022-04-28T10:40:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter2](https://avatars.discourse-cdn.com/v4/letter/p/d2c977/32.png) [@peter2](https://community.prismic.io/u/peter2)\
**Post date:** [April 28, 2022, 10:40am UTC](https://community.prismic.io/t/changing-field-type-unexpected-behaviour/9900/1 "2022-04-28T10:40:17Z")

</div>

There is a glitch in the system that requires manual intervention similar to the not applied default values.

When you change a field type - ie from RichText to Text by either deleting or modifying the json model - and you keep the Api ID, the original values of those fields will still be shown in the Prismic UI in each document, but the API will return null. Once you make a slight change on any field and republish the doc, the api fields are populated with the original value.

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [April 29, 2022, 3:32pm UTC](https://community.prismic.io/t/changing-field-type-unexpected-behaviour/9900/3 "2022-04-29T15:32:08Z")

</div>

Hi @peter2,

Thanks for reaching out.

This is not an issue but is meant to be by design to avoid breaking the production website when somebody changes a custom type. When you change a custom type, you need to minor modifications, save, and publish as explained in this [article](https://prismic.io/docs/core-concepts/custom-types#what-happens-when-you-modify-a-custom-type).

Please let us know if you need any further assistance,  
Fares

---

<div class="post-metadata">

**Author:** ![peter2](https://avatars.discourse-cdn.com/v4/letter/p/d2c977/32.png) [@peter2](https://community.prismic.io/u/peter2)\
**Post date:** [April 29, 2022, 3:42pm UTC](https://community.prismic.io/t/changing-field-type-unexpected-behaviour/9900/4 "2022-04-29T15:42:43Z")

</div>

Hi Faes,

I'm not talking about changing the custom type, but changing a field type from Rich Text to Text. The article only refers to Custom Types and I have not seen any other article that talks about changing field types.

Tthe way it's currently handled is at least misleading and broke my production website because as soon as I changed the field type and deployed the code, Prismic incorrectly showed values, but the API field was empty and thus the production website content was missing/broken.

The additional issue which I forgot to mention was that I had to rewrite the text as the converted RichtText to Text value had non-beaking spaces `&nbsp;` instead of normal spaces. So, in those cases it broke the website twice.

Peter

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [May 3, 2022, 1:24am UTC](https://community.prismic.io/t/changing-field-type-unexpected-behaviour/9900/6 "2022-05-03T01:24:01Z")

</div>

@peter2, we've mentioned this in different threads in the past. Prismic can't know that a field has been changed to another type. So you need to be careful when moving from field types. See Phil's related response about this topic:

> [@Migrating from 'Select' to 'Key Text' field type](https://community.prismic.io/t/migrating-from-select-to-key-text-field-type/1260/2):
>
> Hey Luke, This is a really tricky one given that you’re trying to get the selected data of the select field. There’s no way the Prismic will remember this even if you keep the same API ID. The only solution that I can see here is to use the [import/export feature](https://user-guides.prismic.io/en/articles/846079-introduction-to-import-export) that starts on the medium plan. You can export the current set up and run a script to get the select data and convert it in to key text fields. Then change your custom types and re-import the new restructured data. Let me know if you…
