Change array to object and extract certain characters from it
Hi, I am trying to change the array to an object and after that only get the value between the () Example: Input [ { “Systems” : [“Ardoq (431)”, “SnapLogic (780)”] } { “Systems” : [“SnapLogic (780)”] } ] Expected output: [ { “Systems” : “431”, “Systems” : “780” } { “Systems” : “780” } ] Pipeline is below with the transformation I already tried with toObject… get_valuesFromArray_2022_07_11.slp (6.2 KB) And I tried also this replace transformation from my last topic: Map expression regex - #6 by JensDeveloper and then change it to ‘(’ to extract the character afther the ‘(’ Regards JensSolved3.4KViews0likes2CommentsMap expression regex
Hi, A simple one for the people that are expert in regex. I’m still learning it. So, I have a key: notes that contains a value : “#IF:SLG-01-SL + some text here” My goal is to always get the 9 characters after an ‘#IF:’ My expression I tried in the regex and works: ([#IF:])(.{0,12}) But how do I put it into a mapper? First i check whether the notes contains ‘#IF:’ if thats true it goes to the path where i need to do the regex in the mapper $notes.replace($notes, /([#IF:])(.{0,12})/g) but now it gives the string of the regex. Regards JensSolved8.1KViews0likes6CommentsRouter Snap Expression for checking Value
We have a Router Snap that evaluates a string and checks whether it matches one of a set of predefined values. I can’t seem to get the expressions right and think a short circuit evaluation is at play here? The logic is as follows If Status CONTAINS either X, Y or Z then send to Output A If Status DOES NOT CONTAIN either X, Y or Z then send to Output B The logic I started with before looking at the contains and includes functions $Status == (‘X’ || ‘Y’ || ‘Z’) $Status != (‘X’ || ‘Y’ || ‘Z’) Will a basic course in javascript help increase accessibility when building expressions in SnapLogic?Solved4.3KViews0likes3CommentsNeed 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 arun7.6KViews0likes10Comments