Dataform values provider using Array with custom object not working as expected


#1

Hello,

I’ve “Picker” type entity on dataform with values provider as below

get provinceProvider(){
if(!this._provinceProvider){
this._provinceProvider = {
key: “id”,
label: “name”,
//items: JSON.parse(appSettings.getString(“provinces”))
items:[{
“id”: “2”,
“name”: “The Eastern Cape”
}, {
“id”: “3”,
“name”: “The Free State”
}, {
“id”: “4”,
“name”: “Gauteng”
}, {
“id”: “5”,
“name”: “KwaZulu-Natal”
}, {
“id”: “6”,
“name”: “Limpopo”
}, {
“id”: “7”,
“name”: “Mpumalanga”
}, {
“id”: “8”,
“name”: “The Northern Cape”
}, {
“id”: “9”,
“name”: “North West”
}, {
“id”: “10”,
“name”: “The Western Cape”
}]
};
}
return this._provinceProvider;
}

Labels are correctly getting displayed, but when I pick an item underlying source property “provinceId” is getting assigned the “label” instead of the “id”, below is the value of provinceId printed to console during dfPropertyCommitted.

I"m expecting the value of “4” to be assigned to “provinceId”?


#2

Could anybody confirm if I’m doing something wrong here, or there is an actual issue Dataform?