# State is not updated for symbols

**URL:** <https://forum.builder.io/t/state-is-not-updated-for-symbols/144>\
**Category:** Bugs\
**Tags:** reusable-content\
**Created:** [July 20, 2020, 10:53am UTC](https://forum.builder.io/t/state-is-not-updated-for-symbols/144 "2020-07-20T10:53:38Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevva](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/kevva/32/55_2.png) [@kevva](https://forum.builder.io/u/kevva)\
**Post date:** [July 20, 2020, 10:53am UTC](https://forum.builder.io/t/state-is-not-updated-for-symbols/144/1 "2020-07-20T10:53:38Z")

</div>

I have a symbol where I fetch some data depending on the user input and then set it on the state. I then use the state to populate some text fields. However, sometimes the text fields aren’t getting populated for some reason even though I can see that the data exists on state.

I’m not sure if this could have something to do with the page, because it works sometimes, and sometimes not which is unfortunate.

---

<div class="post-metadata">

**Author:** ![maddy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/maddy/32/11_2.png) [@maddy](https://forum.builder.io/u/maddy)\
**Post date:** [July 20, 2020, 1:33pm UTC](https://forum.builder.io/t/state-is-not-updated-for-symbols/144/2 "2020-07-20T13:33:38Z")

</div>

Hi @kevva! Thanks for reaching out.

Can you send the link to the Builder page this is occurring on? I’d be happy to take a look 😁

---

<div class="post-metadata">

**Author:** ![kevva](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/kevva/32/55_2.png) [@kevva](https://forum.builder.io/u/kevva)\
**Post date:** [July 20, 2020, 2:29pm UTC](https://forum.builder.io/t/state-is-not-updated-for-symbols/144/3 "2020-07-20T14:29:01Z")

</div>

Hey @maddy, I PM:ed you with the page.

---

<div class="post-metadata">

**Author:** ![kara](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/kara/32/80_2.png) [@kara](https://forum.builder.io/u/kara)\
**Post date:** [July 20, 2020, 6:43pm UTC](https://forum.builder.io/t/state-is-not-updated-for-symbols/144/4 "2020-07-20T18:43:22Z")

</div>

Hi! While we’re looking into this for you, would you mind sending over the code for any custom components you’ve used? Thanks!

---

<div class="post-metadata">

**Author:** ![kara](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/kara/32/80_2.png) [@kara](https://forum.builder.io/u/kara)\
**Post date:** [July 20, 2020, 8:24pm UTC](https://forum.builder.io/t/state-is-not-updated-for-symbols/144/5 "2020-07-20T20:24:13Z")

</div>

After investigating, it appears that for products that have no sku, those products aren’t passing the condition `state.product.sku` and that’s why you’re seeing undefined.

---

<div class="post-metadata">

**Author:** ![kevva](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/kevva/32/55_2.png) [@kevva](https://forum.builder.io/u/kevva)\
**Post date:** [July 20, 2020, 9:14pm UTC](https://forum.builder.io/t/state-is-not-updated-for-symbols/144/6 "2020-07-20T21:14:23Z")

</div>

@kara, but even for those with an SKU, the state isn’t set. If I log when I fetch the data inside the symbol, I can see it being fetched. However, maybe it’s because some of them are nested or something? I.e there’s a product price symbol inside another product price symbol.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/builder/original/1X/426f12818fe066b83b74b48c7cc8b54ac63e4997.jpeg)

---

<div class="post-metadata">

**Author:** ![kevva](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/kevva/32/55_2.png) [@kevva](https://forum.builder.io/u/kevva)\
**Post date:** [July 21, 2020, 12:10pm UTC](https://forum.builder.io/t/state-is-not-updated-for-symbols/144/7 "2020-07-21T12:10:19Z")

</div>

Also, when I look at a page in Builder, some of the data is fetched (on the client though), but since we’re using AMP we need it to be fetched on the server which I think the custom JS should do, right?

Could be related to [Running Custom Javascript SSR doesn't seem to work](https://forum.builder.io/t/running-custom-javascript-ssr-doesnt-seem-to-work/81/6).

If you want an example I can PM you the pages.

---

<div class="post-metadata">

**Author:** ![kara](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/kara/32/80_2.png) [@kara](https://forum.builder.io/u/kara)\
**Post date:** [July 21, 2020, 6:06pm UTC](https://forum.builder.io/t/state-is-not-updated-for-symbols/144/8 "2020-07-21T18:06:11Z")

</div>

Just to follow-up, I noticed the `undefined` has been resolved in the editor. What changes did you make on your end?

As for the AMP page, if you could send me the page, that would be helpful. Thanks!

---

<div class="post-metadata">

**Author:** ![ismailp](https://avatars.discourse-cdn.com/v4/letter/i/87869e/32.png) [@ismailp](https://forum.builder.io/u/ismailp)\
**Post date:** [July 22, 2020, 5:06pm UTC](https://forum.builder.io/t/state-is-not-updated-for-symbols/144/9 "2020-07-22T17:06:33Z")

</div>

@kara the changes we did was to run the functions again manually. Seems like custom functions are not running in SSR as Kevin pointed out in his previous comment.
