I have the following payload:
{
"code": 200,
"message": "Request response is successful",
"data": [
{
"origin_info": {
"trackinfo": [
{
"checkpoint_date": "2022-07-14 15:40:23",
"tracking_detail": "Departed from Facility.",
"location": "NL",
"checkpoint_delivery_status": "transit",
"checkpoint_delivery_substatus": "transit001"
},
{
"checkpoint_date": "2022-07-14 11:50:22",
"tracking_detail": "Arrived at Sort Facility.",
"location": "NL",
"checkpoint_delivery_status": "transit",
"checkpoint_delivery_substatus": "transit001"
},
{
"checkpoint_date": "2022-07-13 16:57:00",
"tracking_detail": "Arrived at AIRPORT of Destination",
"location": null,
"checkpoint_delivery_status": "transit",
"checkpoint_delivery_substatus": "transit004"
},
{
"checkpoint_date": "2022-07-13 12:42:00",
"tracking_detail": "Departed from AIRPORT of Origin",
"location": null,
"checkpoint_delivery_status": "transit",
"checkpoint_delivery_substatus": "transit001"
},
{
"checkpoint_date": "2022-07-12 10:33:43",
"tracking_detail": "Arrive at international airport to abroad",
"location": "CHINA",
"checkpoint_delivery_status": "transit",
"checkpoint_delivery_substatus": "transit001"
},
{
"checkpoint_date": "2022-07-12 08:33:43",
"tracking_detail": "Departed Facility In processing center",
"location": "Shanghai",
"checkpoint_delivery_status": "transit",
"checkpoint_delivery_substatus": "transit001"
},
{
"checkpoint_date": "2022-07-11 02:14:02",
"tracking_detail": "Departed Facility in Shanghai",
"location": "Shanghai",
"checkpoint_delivery_status": "transit",
"checkpoint_delivery_substatus": "transit001"
},
{
"checkpoint_date": "2022-07-11 00:33:20",
"tracking_detail": "Arrived at Sort Facility Shanghai",
"location": "Shanghai",
"checkpoint_delivery_status": "transit",
"checkpoint_delivery_substatus": "transit001"
},
{
"checkpoint_date": "2022-07-09 21:36:44",
"tracking_detail": "Arrived at Sort Facility Zhengzhou",
"location": "Zhengzhou",
"checkpoint_delivery_status": "transit",
"checkpoint_delivery_substatus": "transit001"
},
{
"checkpoint_date": "2022-07-09 10:20:51",
"tracking_detail": "Shipment information received Last mile tracking number:00370724762191835799 - Last mile tracking carrier:NO Helthjem",
"location": null,
"checkpoint_delivery_status": "transit",
"checkpoint_delivery_substatus": "notfound001"
},
{
"checkpoint_date": "2022-07-09 02:54:20",
"tracking_detail": "Departed from Facility Zhengzhou",
"location": "Zhengzhou",
"checkpoint_delivery_status": "transit",
"checkpoint_delivery_substatus": "transit001"
}
]
}
}
]
}
I want the flow to continue only if the string Last mile
is found inside one of the tracking_detail
.
In this particular payload, it is found inside payload.data[0].origin_info.trackinfo[9].tracking_detail
This string can appear in any element in the array, not always in trackinfo[9]
as in this example (however, data
is always data[0]
)
For example the next time the payload arrives it can be in trackinfo[7]
. As long as it exists in the payload, I want the flow to continue. If not, I want to route the message somewhere else.
Can anyone help me with this?