Solspace Freeform pass variable to form
You can pass values from other Craft elements or from URL segments, etc to your Freeform forms. Specifically when using with the Element fieldtype, when wanting to override the return URL, you can do something like this:

{{ form.renderTag({
  returnUrl: entry.thankyouUrl
}) }}


When wanting to override Freeform field data values or options, you can do something like this:

{{ form.renderTag({
   overrideValues: {
      hiddenFieldHandle: entry.id,
      stateSelect: "AZ",
      availability: ["tue", "thu"],
   }
}) }}