# {{request\_contact}} object is empty on first page load

**URL:** <https://community.hubspot.com/t/request-contact-object-is-empty-on-first-page-load/32586>\
**Category:** CMS Development\
**Created:** [March 3, 2021, 9:15am UTC](https://community.hubspot.com/t/request-contact-object-is-empty-on-first-page-load/32586 "2021-03-03T09:15:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![shivammishra](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/shivammishra/32/57633_2.png) [@shivammishra](https://community.hubspot.com/u/shivammishra)\
**Post date:** [March 3, 2021, 9:15am UTC](https://community.hubspot.com/t/request-contact-object-is-empty-on-first-page-load/32586/1 "2021-03-03T09:15:27Z")

</div>

I am using bunch of contact properties via request\_contact object in templates and modules( **eg. request\_contact.contact.email** ) but sometimes it gives empty results on first page load right after I am submitting a form with hubspotutk value to set the user identity in his/her browser.

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [March 3, 2021, 9:49pm UTC](https://community.hubspot.com/t/request-contact-object-is-empty-on-first-page-load/32586/2 "2021-03-03T21:49:04Z")

</div>

@shivammishra

Bringing in @tjoyce to help out with this (he is pretty good at this stuff, but don’t let him know)

---

<div class="post-metadata">

**Author:** ![tjoyce](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tjoyce/32/88832_2.png) [@tjoyce](https://community.hubspot.com/u/tjoyce)\
**Post date:** [March 3, 2021, 10:15pm UTC](https://community.hubspot.com/t/request-contact-object-is-empty-on-first-page-load/32586/3 "2021-03-03T22:15:54Z")

</div>

@shivammishra - I might need more information on your data flow but, I think it does make sense that it’s empty if you’re setting the contact properties via javascript.

There are a couple of things to note…

1. {{request\_contact}} is server side code so, if you’re setting the utk in js, you would need to do a hard refresh on the page to re-render that dict properly

2. Be mindful of where the form is rendered and submitted in the page’s javascript callstack. Although the forms appear quickly (visually) - it is generally loaded at an inconsistent time during page load and sometimes the data might be available and sometimes it isn’t. so, if you are trying to populate a form, make sure you’re using the javascript global events form callback api

> **[Accounts Dashboard | HubSpot](https://app.hubspot.com/myaccounts?next=developerdocs&redirect=%2Freference%2Fcms%2Fforms)**

---

<div class="post-metadata">

**Author:** ![GwaltonASJ](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@GwaltonASJ](https://community.hubspot.com/u/GwaltonASJ)\
**Post date:** [May 2, 2022, 2:51pm UTC](https://community.hubspot.com/t/request-contact-object-is-empty-on-first-page-load/32586/4 "2022-05-02T14:51:30Z")

</div>

This is actually happening to me on my chromebook while entering the outcome for calls. When I use my partners ASUS it loads perfectly, every time the first time. When I use my chromebook I have to reload every page to code the call properly. I can always leave notes but most of the time my fields are empty.

---

<div class="post-metadata">

**Author:** ![shivammishra](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/shivammishra/32/57633_2.png) [@shivammishra](https://community.hubspot.com/u/shivammishra)\
**Post date:** [March 4, 2021, 10:17am UTC](https://community.hubspot.com/t/request-contact-object-is-empty-on-first-page-load/32586/5 "2021-03-04T10:17:48Z")

</div>

So user first lands on a hubspot page where hubspotutk cookie gets generated then I redirect user to a separate nodeJs application [outside hubspot] where I submit the form with hubspotutk cookie value using form submission API ([https://legacydocs.hubspot.com/docs/methods/forms/submit\_form )](https://legacydocs.hubspot.com/docs/methods/forms/submit_form%5D) and then I am redirecting user to another hubspot page where I am trying to show user’s first name which does not happen at first load.

In another scenario, I update one of the contact’s custom property via serveless function which is called in a hubspot page using ajax and then I redirect user to another hubspot page where I am trying to show the value of that custom property but its empy on first load.

---

<div class="post-metadata">

**Author:** ![tjoyce](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tjoyce/32/88832_2.png) [@tjoyce](https://community.hubspot.com/u/tjoyce)\
**Post date:** [March 4, 2021, 10:39am UTC](https://community.hubspot.com/t/request-contact-object-is-empty-on-first-page-load/32586/6 "2021-03-04T10:39:31Z")

</div>

Thank you for the clarification @shivammishra - That makes total sense now.

I’m honestly not sure if HS pushes the data into a queue before attaching it to the user. They might be doing that to improve response times of their API calls. This does sound like a question for a bigger gun than myself. (or maybe you found a real life legit bug). Can you pass the data as URL parameters instead?

You might also have better success posting the question in

[https://community.hubspot.com/t5/APIs-Integrations/bd-p/integrations](https://community.hubspot.com/t5/APIs-Integrations/bd-p/integrations)

---

<div class="post-metadata">

**Author:** ![shivammishra](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/shivammishra/32/57633_2.png) [@shivammishra](https://community.hubspot.com/u/shivammishra)\
**Post date:** [March 4, 2021, 10:44am UTC](https://community.hubspot.com/t/request-contact-object-is-empty-on-first-page-load/32586/7 "2021-03-04T10:44:39Z")

</div>

Thanks @tjoyce . Ill post this question under the recommended category.

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [March 4, 2021, 8:54pm UTC](https://community.hubspot.com/t/request-contact-object-is-empty-on-first-page-load/32586/8 "2021-03-04T20:54:30Z")

</div>

Hey @shivammishra

I believe you might want to submit a support request for this one. Looks like your portal qualifies.

Here is a [link](https://www.hubspot.com/company/contact)

---

<div class="post-metadata">

**Author:** ![shivammishra](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/shivammishra/32/57633_2.png) [@shivammishra](https://community.hubspot.com/u/shivammishra)\
**Post date:** [March 5, 2021, 8:39am UTC](https://community.hubspot.com/t/request-contact-object-is-empty-on-first-page-load/32586/9 "2021-03-05T08:39:07Z")

</div>

So I tested it thouroughly and found that its because of the time hubspot APIs take to update the record as mentioned by @tjoyce and I am not sure if support would be able to help much here for this one usecase so I have handled it by checking at my end and only letting the user move forward when API sends the updated response. That way user sees the page only when {{request\_contact}} object has the updated data.

Appreciate the help!! Thanks, you both.
