# Append Hubspot form's data-instance-id to cloudfront link on redirect page

**URL:** <https://community.hubspot.com/t/append-hubspot-forms-data-instance-id-to-cloudfront-link-on-redirect-page/65289>\
**Category:** APIs & Integrations\
**Tags:** webhooks\
**Created:** [September 16, 2022, 6:58pm UTC](https://community.hubspot.com/t/append-hubspot-forms-data-instance-id-to-cloudfront-link-on-redirect-page/65289 "2022-09-16T18:58:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sweetweaver](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sweetweaver/32/48165_2.png) [@sweetweaver](https://community.hubspot.com/u/sweetweaver)\
**Post date:** [September 16, 2022, 6:58pm UTC](https://community.hubspot.com/t/append-hubspot-forms-data-instance-id-to-cloudfront-link-on-redirect-page/65289/1 "2022-09-16T18:58:09Z")

</div>

I’m working on a project where we’re using a Hubspot form embedded on the intro page in Wordpress. Once the form is completed, it redirects to another Wordpress page with an iframe that uses a Cloudfront URL. What we’d like to do is append Hubspot’s unique data-instance-id from the form to the second page’s URL. I imagine there is a script out there that might do this.

Does anyone have experience with this?

---

<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:** [September 22, 2022, 6:56pm UTC](https://community.hubspot.com/t/append-hubspot-forms-data-instance-id-to-cloudfront-link-on-redirect-page/65289/2 "2022-09-22T18:56:29Z")

</div>

Hi, @sweetweaver 👋 Thanks for reaching out! Hey [@ChehakWadhdwa](https://community.hubspot.com/t5/user/viewprofilepage/user-id/345416), do you have any experience here?

Thank you! — Jaycee

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [September 26, 2022, 3:23am UTC](https://community.hubspot.com/t/append-hubspot-forms-data-instance-id-to-cloudfront-link-on-redirect-page/65289/3 "2022-09-26T03:23:35Z")

</div>

Hey [@](https://community.hubspot.com/t5/user/viewprofilepage/user-id/379041)[sweetweaver](https://community.hubspot.com/t5/user/viewprofilepage/user-id/81401)

window.addEventListener(“message”, function(event){

if(event.data.type === ‘hsFormCallback’ && event.data.eventName === ‘onFormReady’) {

var $form = $(‘form[data-form-id="’ + event.data.id + ‘"]’);

var $firstName = $form.find(‘name=[“first\_name”]’);

$firstName.val(linkedInAutofill.first\_name);

}

});

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regards.

---

<div class="post-metadata">

**Author:** ![sweetweaver](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sweetweaver/32/48165_2.png) [@sweetweaver](https://community.hubspot.com/u/sweetweaver)\
**Post date:** [September 26, 2022, 6:34pm UTC](https://community.hubspot.com/t/append-hubspot-forms-data-instance-id-to-cloudfront-link-on-redirect-page/65289/4 "2022-09-26T18:34:18Z")

</div>

This is exactly what we needed. Thank you so much!
