Hello
My developer created this field structure :
"realization": {
"id": 24188,
"releasedOn": null,
"isAnticipated": false,
"reason": null,
"realizationPeriods": [
{
"id": 373967,
"label": "Janvier 2024",
"realizationPeriodVolumes": [
{
"id": 758155,
"workUnit": {
"id": 269,
"label": "my Label",
"volumeMax": "650.00",
"volumeAverage": "350.00"
}
},
{
"id": 758156,
"workUnit": {
"id": 270,
"label": "Heures en entreprise",
"volumeMax": "140.00",
"volumeAverage": "70.00"
}
}
]
}
]
}
I need to access this specific field :
realization.realizationPeriods.realizationPeriodVolumes.workUnit.label
I tried with scripted field :
if (doc['realization.realizationPeriods.realizationPeriodVolumes.workUnit.label'].size() == 0) return '';
try {
return doc['realization.realizationPeriods.realizationPeriodVolumes.workUnit.label.keyword'].value;
} catch(Exception e) {
return 'N/A';
}
But it returns no values. I tried everything, can't figure what is wrong.
Is this because my "workUnit" field is inside an array ?
Can someone give me the solution ? I spent hours
Thanks !