โ06-19-2023 12:23 PM
Hello Community,
I have been trying hard to build a logic urgently. Iโm requesting SnapLogic expression language experts to assist here.
I have the input data like below and need to get the phone โnumberโ filed validating 3 conditions.
To detail: $ phones[ < find type = Mobile >].utilizationMeanings[ < find type= voice >].dates[< find endDate ==null>].number
{
โphoneโ: [
{
โnumberโ: โ123456789โ,
โtypeโ: โMobileโ,
โutilizationMeaningsโ: [
{ โtypeโ: โVoiceโ,
โdatesโ: [
{โstartDateโ: โ2023-05-31T12:08:47.503Zโ,โendDateโ: null }
]
},
{
โtypeโ: โTextโ,
โdatesโ: [
{โstartDateโ: โ2023-05-30T00:00:00โ, โendDateโ: null }
]
}
]
}
]
}
โ06-19-2023 11:06 PM
Hi @kachanta
Try this expression: You can find more details on jsonPath here.
Pipeline:
NumberValidation_Using_JSONPATH.slp (3.9 KB)
I hope this helps ๐
Cheers
โ06-20-2023 07:19 AM
Here we have hardcoded [0] which brings only first element, but there are multiple elements in each array. We need to filter 1 based on the value matching.
โ06-20-2023 11:19 AM
It would be a great help if someone could help me on this.
Ideas pleaseโฆ
โ06-20-2023 11:02 PM
Can you share sample input with multiple items?