โ05-19-2020 03:05 AM
Hi,
I want to check the value of Description in each item in the below JSON and route seperately if all are same and seperately if theyโre different. How can I do this?
[
{
โSEGMENT1โ: โ104155โ,
โDESCRIPTIONโ: โEURโ,
โUNIQUE_IDโ: โ224โ,
โITEM_NUMBERโ: โ0113โ
},
{
โSEGMENT1โ: โ104154โ,
โDESCRIPTIONโ: โAEDโ,
โUNIQUE_IDโ: โ224โ,
โITEM_NUMBERโ: โ0103โ
},
{
โSEGMENT1โ: โ104153โ,
โDESCRIPTIONโ: โUSDโ,
โUNIQUE_IDโ: โ224โ,
โITEM_NUMBERโ: โ0090โ
},
{
โSEGMENT1โ: โ104153โ,
โDESCRIPTIONโ: โUSDโ,
โUNIQUE_IDโ: โ224โ,
โITEM_NUMBERโ: โ0014โ
},
{
โSEGMENT1โ: โEXTRA_EVENTโ,
โDESCRIPTIONโ: null,
โUNIQUE_IDโ: null,
โITEM_NUMBERโ: null
}
]
Regards,
Darshita
โ05-19-2020 03:26 AM
Hello @Darshita
You can use Group By Fields snap, and group your records by DESCRIPTION field , then downstream Router snap that will route records based on DESCRIPTION field.
Best Regards
Dimche Saveski
โ06-02-2020 10:02 PM
Is the array streaming document? So I put your array into an object Items
basically the objective is to have an array of description where length is equal to 1 meaning all have the same descriptions. See screenshots below
eval($Items.map((a)=> a[โDESCRIPTIONโ]).filter((x,y,z)=> z.indexOf(x) == y).length == 1)