Answers.Body: <p>Actually saw that earlier in the documents: <a href="https://docs.solspace.com/craft/freeform/v3/overview/relations.html#overview" rel="nofollow noreferrer">https://docs.solspace.com/craft/freeform/v3/overview/relations.html#overview</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-16T03:12:53.443Z
Answers.Text: reading now but this looks really promising ... amazing how i can miss stuff like that even after reading docs/google/etc ... thanks!
Answers.UserDisplayName: Erant
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-15T23:02:32.377Z
Answers.LastActivityDate: 2019-10-15T23:02:32.377Z
Answers.UserDisplayName: mmc501
Body: <p>I'm using FreeForm and need to create a relationship between form submissions and the user that submitted them.  </p>
  
  <p>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)?</p>
  
  <pre><code>{% requireLogin %} {#check user is logged in #}
  {{ craft.freeform.form("employeeForm", {
    overrideValues: {
      userId: currentUser.id,
    }
  }).render() }}
  </code></pre>
  
Tags: <plugin-freeform><solspace>
Title: What is the correct way to attribute FreeForm submissions to users?
ThreadText: # What is the correct way to attribute FreeForm submissions to users?
  
  (Asked by: username_0 on 2019-10-15)
  
  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() }}
  
  ```
  
  **Tags:** plugin-freeform, solspace
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-10-15. Score: 1 | Accepted answer
  
  Actually saw that earlier in the documents: <https://docs.solspace.com/craft/freeform/v3/overview/relations.html#overview>
  
  > **Comments:**
  > **username_0**: reading now but this looks really promising ... amazing how i can miss stuff like that even after reading docs/google/etc ... thanks!  
  
  ---
  
  