# Prepopulating mautic form with variables from URL

**URL:** <https://forum.mautic.org/t/prepopulating-mautic-form-with-variables-from-url/21317>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [October 18, 2021, 3:33pm UTC](https://forum.mautic.org/t/prepopulating-mautic-form-with-variables-from-url/21317 "2021-10-18T15:33:15Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![2io](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/2io/32/7383_2.png) [@2io](https://forum.mautic.org/u/2io)\
**Post date:** [May 16, 2022, 7:04pm UTC](https://forum.mautic.org/t/prepopulating-mautic-form-with-variables-from-url/21317/8 "2022-05-16T19:04:53Z")

</div>

Hello, I have V4.2.2 on VPS installed. I just tried prepopulating the email-field on the form that I added to this landing page: [https://m.ionutojica.ro/actualizarea-numarului-de-telefon?email=test@test.com](https://m.ionutojica.ro/actualizarea-numarului-de-telefon?email=test@test.com)  
It doesn´t seam to work. It should work, as you mention. Is it a bug in V4.2.2 ?  
I am thinking to add this code to my page ([https://stackoverflow.com/a/14070223](https://stackoverflow.com/a/14070223))

```auto
var hashParams = window.location.hash.substr(1).split('&'); // substr(1) to remove the `#`
for(var i = 0; i < hashParams.length; i++){
    var p = hashParams[i].split('=');
    document.getElementById(p[0]).value = decodeURIComponent(p[1]);;
}

```

An older post (2017) I found, that mention the prepopulating the form-fields should work is this one: [Link for leads to update their profile - #5 by Adam](https://forum.mautic.org/t/link-for-leads-to-update-their-profile/5304/5) .

Do you have an idea, what am I missing?  
I am not logged in, I use private session or other browser - the same happens.

---

_[View the full topic](https://forum.mautic.org/t/prepopulating-mautic-form-with-variables-from-url/21317)._
