Forum Discussion
That's the only way since your string is definitely not valid JSON. You need it to look like this:
{"language": "Tamil", "taskId": 123}
Hello again, ptaylor,
Actually, there is an issue with this...
I took the results below from the Expression Builder. You can see at line 31 that I'm doing all the replacements on all the items in the list (3 elements labelled each "German", "French (Europe)" and "Italian"). At line 32 you can see after the .parse method that my JSON after parsing has only one element now (labelled "German"). So I'm losing everything except the first entry.
31: ([jsonPath($, "$sameLanguage[*].REQUESTEDLANGUAGES").toString().replaceAll('=', '" : "').replaceAll('},{', '"},{"').replaceAll(', ', '", "').replace(/^{/, "{\"").replace(/}$/, "\"}")].toString()):
{
jsonEncodedString: "{"language" : "German", "taskId" : "43251-1-2"},{"language" : "French (Europe)", "taskId" : "43251-1-3"},{"language" : "Italian", "taskId" : "43251-1-4"}"
}
32: .parse:
[
{
language:"German"
taskId:"43251-1-2"
}
]
Can you see what I'm doing wrong to have this bad results?
Thanks!
JF
Thanks a lot - while it did require quite some refactoring (the pipelines should use accounts, not a variable as token, there is a lot of complexity reduction possible with the shared pipelines) - this is what we were looking for to get started, so i’m happy to say - after half a days worth of work - this is now in production and running our “nightly export”.