For running J!5.1 you must https://fabrikar.com/forums/index.php?wiki/update-from-github/ or include the new file manually https://fabrikar.com/forums/index.php?threads/joomla-5-1-and-fabrik-cannot-find-files-error.54473/post-285151 See also Announcements
Please see our announcement here.
$formModel->groups[28]->elements[157]->element->label = "MODIFIED LABEL";
$formModel->data['date_test___name'] = "modified value";
$formModel->data['date_test___name_raw'] = "modified value";
$formModel->groups[28]->elements[157]->element->label = $formModel->data['date_test___name_raw'];
Table b is a related data of table a.
$countryId = $formModel->data['region___country_id_raw'];
$myDb = FabrikWorker::getDbo();
$myQuery = $myDb->getQuery(true);
$myQuery->select('question_value')->from('country')->where('id = ' . $myDb->quote($countryId));
$myDb->setQuery($myQuery);
$questionValue = $myDb->loadResult();
$formModel->groups[28]->elements[157]->element->label = $questionValue;
$formModel->groups[28]->elements[157]->element->label = $questionValue;
I used that code into the php plugin of 'region' form (onBeforeLoad),
... which uses a form PHP plugin running onLoad.