Editing a freeform submission entry I have a custom plugin where I get a freeform submission by token. I woud like to change a value in this submission and resave the submission. When I try this the old form data gets overwritten.
$submission = Freeform::getInstance()-&gt;submissions-&gt;getSubmissionByToken($submissionToken);

$submission-&gt;setFormFieldValues(['customField' =&gt; $customFieldValue]);

// method 1, doesn't accept type submission, should be form     
Freeform::getInstance()-&gt;submissions-&gt;storeSubmission($submission);
// method 2, old data get's overwritten, current submissiontoken changes
Craft::$app-&gt;elements-&gt;saveElement($submission);
It looks like setFormFieldValues() has an optional second parameter related to overriding values...
public function setFormFieldValues(array $values, bool $override = true)
So, changing...
$submission-&gt;setFormFieldValues(['customField' =&gt; $customFieldValue]);
... to...
$submission-&gt;setFormFieldValues(['customField' =&gt; $customFieldValue], false);
may help with the override issue.