How to post an engine variable in a html select

I have a html select populated with the content of an engine variable, which, of course, is a list:

<select id="gender" ng-model="cuitInfo">
	<option ng-repeat="referencia in cuitsInfo.referencia" value="{{referencia}}">{{referencia.nombre}}</option>
</select>  

This html code generates:

<select id="gender" ng-model="cuitInfo" class="ng-valid ng-dirty">
	<!-- ngRepeat: referencia in cuitsInfo.referencia -->
	<option ng-repeat="referencia in cuitsInfo.referencia"
		value="{'nombre':'MUIÑOS JOSE CARLOS','cuil':20234567897,'infoAdicional':{'fechaNac':'17/12/1972','sexo':'M'}}"
		class="ng-binding ng-scope">MUIÑOS JOSE CARLOS</option><!-- end ngRepeat: referencia in cuitsInfo.referencia -->
	<option ng-repeat="referencia in cuitsInfo.referencia"
		value="{'nombre':'ROMERO CARINA BEATRIZ','cuil':27234567891,'infoAdicional':{'fechaNac':'11/09/1973','sexo':'F'}}"
		class="ng-binding ng-scope">ROMERO CARINA BEATRIZ</option>
	<!-- end ngRepeat: referencia in cuitsInfo.referencia -->
</select>

So far so well…

Now, I want to create a new engine variable called cuitInfo and populate it using value attribute of html option. This is my code:

<form name="manualRating" role="form">

  <script cam-script type="text/form-script">

    var cuitInfo = $scope.cuitInfo = {};

	camForm.on('form-loaded', function() {
		camForm.variableManager.fetchVariable('cuitsInfo');
		camForm.variableManager.createVariable({
			name: 'cuitInfo',
			type: 'json',
			value: cuitInfo
		});
	});

	camForm.on('variables-fetched', function() {
		// after the variables are fetched, bind the value of customerData to a angular
		// scope value such that the form can work on it
		$scope.cuitsInfo = camForm.variableManager.variable('cuitsInfo').value;
	});

  </script>

  <p class="lead">Please provide a rating for the following customer 4</p>
 	<select id="gender" ng-model="cuitInfo">
 		<option ng-repeat="referencia in cuitsInfo.referencia" value="{{referencia}}">{{referencia.nombre}}</option>
	</select>  
	<br>
</form>

Theorically, submitting this form should create a cuitInfo variable in my engine process, but what I have is:

What Im doing wrong ?

Thanks in advance

Hi @Maximiliano_Carrizo,

Have you already tried to use track by inside your ng-repeat? This could look like this for example:

ng-repeat="referencia in cuitsInfo.referencia track by referencia"

Angularjs assigns a unique $$hashKey property to each item in the array. This property is then used as a key.

Does it help you?

Cheers,
Roman

Yes, it did. Thank you very much !