Set value of Component TextArea in FormAction

Hello, how can i change the value of a TextArea when a button is pressed? Currently have this code in the class that extends CreateRecord but the ->value() function doesnt work:

$forms = $this->getForms();
$form = Arr::first($forms);
$sqlComponent = $form->getComponents()[0];
$textArea = $sqlComponent->getChildComponents()[1];
$translatedSql = "translated";
$textArea->value($translatedSql);
Was this page helpful?