Forum Discussion

arunnp's avatar
arunnp
New Contributor II
4 years ago

Need to join the input array of objects to string

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]

[code]

” & $Header & “


”,
$join($Request.ChatHist.($.content_type != “srn” ? ($.created_by=“abc” ? “[code]” & “VA: " &”" : "[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

10 Replies

  • dmiller's avatar
    dmiller
    Former Employee

    I don’t have access to a SharePoint instance but it looks like they have a REST API, so you likely could use the REST Snaps.

  • Using REST snaps you can definitely connect to SharePoint both write and read files.

    what type of Auth mechanism you would be using to connect to sharepoint. If it is using OAuth2 you can achieve this only via REST snaps.

    • GBekkanti's avatar
      GBekkanti
      New Contributor III

      Is it feasible to store temporarily 500 files daily and deleting them after processing by using REST to connect to SharePoint?

      • dmiller's avatar
        dmiller
        Former Employee

        Depends on the size of the files.
        No file uploaded to SnapLogic can be more than 100MB.