forms for every calculated expression is working fine while testing but not populating in fields while populating
for more insight This was the script getting result on testing but not on inputting data in form
var mdm1 = [1,1,2,2,3,3,3,5];
var mdm2 = [1,1,1,2,2,2,2,3];
var mdm;
if (DomainName($feature,"Area_Charectristics") == "Open Forest")
{ mdm=mdm1;}
if (DomainName($feature,"Area_Charectristics") == "Open Grassland")
{ mdm=mdm2;}
if ($feature.RAINFALL=="0"){
return mdm[0];
}
if ($feature.RAINFALL=="1"){
return mdm[1];
}
if ($feature.RAINFALL=="2"){
return mdm[2];
}
if ($feature.RAINFALL=="3"){
return mdm[3];
}
if ($feature.RAINFALL=="4"){
return mdm[4];
}
if ($feature.RAINFALL=="5"){
return mdm[5];
}
if ($feature.RAINFALL=="6"){
return mdm[6];
}
if ($feature.RAINFALL=="7"){
return mdm[7];
}
You're comparing $feature.RAINFALL to a string value. Is the field really a string field?
Also, you can shorten that script like so:
var mdm1 = [1,1,2,2,3,3,3,5];
var mdm2 = [1,1,1,2,2,2,2,3];
var mdm;
if (DomainName($feature,"Area_Charectristics") == "Open Forest")
{ mdm=mdm1;}
if (DomainName($feature,"Area_Charectristics") == "Open Grassland")
{ mdm=mdm2;}
var index = Number($feature.RAINFALL);
return mdm[index]
Thanks for the response
$feature.RAILFALL is a code value
This is also returns value while testing but no updating while inputting through forms