โ08-06-2021 03:29 AM
Hi
The json input I get to the pipeline is array of objects. I need iterate each object data and join as a string.
Also I need to append some html code in between.
Ex: input json
โchathistโ: [{
โcreated_byโ: โtestโ,
โcreated_dateโ: 1626244986151,
โinformation_typeโ: โRequestโ,
โtextโ: "Account ",
โcontentโ: โโ,
โcontent_typeโ: โQuestionโ
}, {
โcreated_byโ: โWsswWโ,
โcreated_dateโ: 1626244990226,
โinformation_typeโ: โResponseโ,
โtextโ: "Clicca sulla Societร alla quale ",
โcontentโ: โโ,
โcontent_typeโ: โtextโ
}, {
โcreated_byโ: โtestโ,
โcreated_dateโ: 1626244998853,
โinformation_typeโ: โRequestโ,
โtextโ: โexample test456โ,
โcontentโ: โโ,
โcontent_typeโ: โsrnโ
}
]
This input array of objects need to parse and join as string. First I need to check array length > 0
I have similar logic using JSonata. I am trying to achieve this using Expression builder.
{{ $count($Request.Hist ) > 0 ?
$join( [ โ[code]
Can we use JSonata in Snaplogicโฆ ? if not how we can achieve this through expression builder. I tried few ways using Array and String function but did not resolve.
Pls suggest.
thanks
arun
โ08-16-2021 02:49 AM
@j.angelevski Thanks fo the solution.
I used your approach to implement the logic to loop through complete input array to read data and to create a formatted text message.
regds
arun