07-11-2022 12:51 AM
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
Jens
Solved! Go to Solution.
07-11-2022 02:31 AM
Hi,
Use the below expression in a mapper. After that use the Splitter snap to get the details.
$Systems.map(x => {“Systems” : x.substring(x.indexOf(“(”)+1, x.indexOf(“)”))})
07-11-2022 02:31 AM
Hi,
Use the below expression in a mapper. After that use the Splitter snap to get the details.
$Systems.map(x => {“Systems” : x.substring(x.indexOf(“(”)+1, x.indexOf(“)”))})
07-11-2022 03:36 AM
Hey @nsingam ,
Thank you for your answer. It works.