Embeded Task form issue

Hi ,

I had created a simple embed user task form having multiple tabs. In one tab i have added 3 input box and tables , once user fill the details and add it will be added to the table . My issue is my $scope couldn’t have access to these variables. I am attaching my forms along with this. testtab.txt is the parent html.

test1.txt (1.1 KB)
testtab.txt (2.1 KB)

Hi Ajr,

the ng-include directive creates a new isolated scope, so that the Camunda forms SDK can not discover what goes on in there. Therefore it can not automatically extract the variable and its value from the input when its part of the ng-include.

The good news is, that when submitting the form, you can still add the variable manually, like this:

camForm.on('submit', function(evt) {
  camForm.variableManager.createVariable({
    name: 'aVariableName',
    type: 'String',
    value: camForm.formElement.find('#someInputElementId')[0].value
  });
});

I hope this helps :slight_smile:

Cheers
Sebastian

Hi @sebastian.stamm ,

Thanks for your reply :slight_smile:
Your code seems to be executed on form submit. I dont want this in form submit. I have a button named “Add” . When user click on add button entry will be added to a grid. Like wise user can add n number of details.

Thanks
Ajr

Hi @sebastian.stamm ,

As you mentioned ng-include directives creates a new scope. I have tried to put both html in one , But i also got the same issue…

I can access these variables and functions

$scope.currentTab
$scope.onClickTab
$scope.isActiveTab
$scope.addRow

But i cannot access

$scope.names
$scope.employeess
$scope.headoffices
$scope.companies

Thanks
Ajr

Sounds like a general angular problem rather than an embedded form problem to me. Did you get it working outside an embedded form?

Hi @sebastian.stamm ,

Yes its not working externally . Can we use angular js routing module in camunda ?

You can use angular services that are available in angular 1.2.29. To do so, you can inject them in your form script, as this example demonstrates.

Its worked. I have given $parent instead of $scope in ng-module

1 Like