# Adding fields to existing slice error

**URL:** <https://community.prismic.io/t/adding-fields-to-existing-slice-error/2204>\
**Category:** Prismic for Content Creators\
**Created:** [October 7, 2020, 5:50pm UTC](https://community.prismic.io/t/adding-fields-to-existing-slice-error/2204 "2020-10-07T17:50:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrey.drozd](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@andrey.drozd](https://community.prismic.io/u/andrey.drozd)\
**Post date:** [October 7, 2020, 5:50pm UTC](https://community.prismic.io/t/adding-fields-to-existing-slice-error/2204/1 "2020-10-07T17:50:53Z")

</div>

Hi, this is somewhat related to this issue ([Structured Text Error - #7 by tim](https://community.prismic.io/t/structured-text-error/1036/7)), which still exists and is a pain in the butt.

I have an existing slice within a custom type with a handful of various field types in the repeatable section of the slice. When I added a key text field to this existing slice, one of the Rich Text Fields, which was null by default before, becomes populated with an empty string. However, when I delete the repeatable section and recreate it as it was before, the Rich Text Field remains null.

Why does this happen? This is very frustrating because it messes with frontend validation logic and it makes me nervous about editing custom types, which is the whole point of Prismic!

---

<div class="post-metadata">

**Author:** ![andrey.drozd](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@andrey.drozd](https://community.prismic.io/u/andrey.drozd)\
**Post date:** [October 7, 2020, 5:54pm UTC](https://community.prismic.io/t/adding-fields-to-existing-slice-error/2204/2 "2020-10-07T17:54:54Z")

</div>

FYI, I am using Prismic through GraphQL and Gatsby (gatsby-source-prismic-graphql plugin)

---

<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:** [October 8, 2020, 5:32am UTC](https://community.prismic.io/t/adding-fields-to-existing-slice-error/2204/3 "2020-10-08T05:32:54Z")

</div>

Hey Andrey, welcome to the forum!

We are currently moving away from the `gatsby-source-prismic-graphql` plugin and starting to use `gatsby-source-prismic` more now. You can read all about it here: [Gatsby-Prismic plugins: what’s going on?](https://prismic.io/blog/gatsby-prismic-plugins)

For the time being, we are still giving some support to the one you're using in a fork made to the plugin, so we are encouraging every Prismic + Gatsby user to replace the `gatsby-source-prismic-graphql` npm package to be `@prismicio/gatsby-source-prismic-graphql`

But, going back to your case, this is very strange behaviour. Can you show me an example o what the API is retrieving, you can use screenshots.

---

<div class="post-metadata">

**Author:** ![andrey.drozd](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@andrey.drozd](https://community.prismic.io/u/andrey.drozd)\
**Post date:** [October 8, 2020, 2:22pm UTC](https://community.prismic.io/t/adding-fields-to-existing-slice-error/2204/5 "2020-10-08T14:22:04Z")

</div>

Hi, Paulina. I am aware of the issues with the gatsby-source-prismic-graphql plugin, but I did not know about the fork. Thank you for letting me know, I will look into that.

This project has two Prismic repos, one staging and one prod. I added the the key text field `ipf_field_name` to the staging repo, along with populating the `label` field, and the API call result is below.

```auto
    "fields": [
                        {
                          "ipf_field_name": null,
                          "label": "Settlement",
                          "universal_value_reference": "settlement",
                          "value": [
                            {
                              "type": "paragraph",
                              "text": "",
                              "spans": []
                            }
                          ]
                        }
                      ]

```

The prod repo does not have the `ipf_field_name` key text field nor do I have the `label` field populated and the API call result is below.

```auto
     "fields": [
                        {
                          "label": null,
                          "universal_value_reference": "settlement",
                          "value": null
                        }
                      ]

```

As you can see, the value field was null before I added the `ipf_field_name` key text field to the slice.

---

<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:** [October 9, 2020, 12:29am UTC](https://community.prismic.io/t/adding-fields-to-existing-slice-error/2204/6 "2020-10-09T00:29:55Z")

</div>

Ok I see, you were right, this is related to the thread you linked at the beginning. It's something we are aware of and still have no ETA or clear plans on modifying this. I totally understand that this can become a problem if it makes the front end break.

What you can do is add extra validation to your Rich text fields so that they don't trigger an error, e.g.:

```
  <RichText render={ slice.fields.ipf_field_namet || [] } />

```

> [@Structured Text Error](https://community.prismic.io/t/structured-text-error/1036/8):
>
> So I talked with some of the team and there doesn’t appear to be structural reason why returning the data like this is necessary and the team will now begin making plans to fix this. I don’t have an ETA of when/if they will do this, but as soon as they have more information or have anymore questions, they will get update you here. Thanks.

---

<div class="post-metadata">

**Author:** ![andrey.drozd](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@andrey.drozd](https://community.prismic.io/u/andrey.drozd)\
**Post date:** [October 9, 2020, 1:13pm UTC](https://community.prismic.io/t/adding-fields-to-existing-slice-error/2204/7 "2020-10-09T13:13:10Z")

</div>

Thanks for the tip, Paulina, I'll look into adding that validation. I look forward to having this problem fixed!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [October 10, 2020, 1:13pm UTC](https://community.prismic.io/t/adding-fields-to-existing-slice-error/2204/8 "2020-10-10T13:13:21Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 9, 2021, 2:57pm UTC](https://community.prismic.io/t/adding-fields-to-existing-slice-error/2204/9 "2021-12-09T14:57:42Z")

</div>


