hi,
i have an issue to output a value . Example below is the output. I need to get the 1st media_type = ' image/jpeg" out of this.
{
"images": [
{
"id": "875871070",
"download_sizes": [
{
"bytes": 69498,
"height": 416,
"media_type": "image/jpeg",
"name": "x_small",
"width": 416
},
{
"bytes": 109213,
"height": 594,
"media_type": "image/jpeg",
"name": "small",
"width": 594
},
{
"bytes": 375336,
"height": 1735,
"media_type": "image/jpeg",
"name": "medium",
"width": 1735
},
{
"bytes": 1255700,
"height": 4000,
"media_type": "image/jpeg",
"name": "large",
"width": 4000
},
{
"bytes": 12135563,
"height": 4000,
"media_type": "image/eps",
"name": "vector",
"width": 4000
}
]
}
],
"images_not_found": []
}
below is my json :
{
"type": "object",
"properties": {
"image": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"download_sizes": {
"type": "object",
"properties": {
"bytes": {
"type": "string"
},
"height": {
"type": "string"
},
"media_type": {
"type": "string"
},
"name": {
"type": "string"
},
"width": {
"type": "string"
}
}
}
}
}
}
}
}
this is the error message i got when trying to output the 'image/jpeg' :
ExpressionEvaluationFailed. The execution of template action 'Apply_to_each_2' failed: the result of the evaluation of 'foreach' expression '@body('ParseFindMediaType')?['image']' is of type 'Null'. The result must be a valid array.
Please advice and thanks in advance