I'm using FreeForm and need to create a relationship between form submissions and the user that submitted them.

To accomplish this I created a hidden variable on my form called userId. I use overridesValues to set the userId to the current user before I render the form. This "feels" wrong to me .. is there a better way to do this? Is this userId already stored in the freemform data model (making what I'm doing uncessesary)?

{% requireLogin %} {#check user is logged in #}
{{ craft.freeform.form("employeeForm", {
  overrideValues: {
    userId: currentUser.id,
}).render() }}

1 Answer 1


Actually saw that earlier in the documents: https://docs.solspace.com/craft/freeform/v3/overview/relations.html#overview

  • reading now but this looks really promising ... amazing how i can miss stuff like that even after reading docs/google/etc ... thanks!
    – Erant
    Oct 16, 2019 at 3:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.