cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Filter in the array

kachanta
New Contributor

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.

  1. Type should be โ€˜Mobileโ€™ in array โ€œphoneโ€
  2. type should be == โ€˜Voiceโ€™ inside the array โ€œutilizationMeaningsโ€
  3. endDate field should be null which is inside another array โ€œdatesโ€ inside โ€œutilizationMeaningsโ€

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 }
]
}
]
}
]
}

5 REPLIES 5

PratapKr_Gayen
New Contributor II

Test_Expression_2023_06_26 (1).slp (13.0 KB)
try this pipeline, hope this will help to solve the current issue.