'Delete first and last quote mule 3
I try to delete the quotes around the payload that is incoming from http request, so I can use it as request for an another call (mule 3).
I use the next transformation syntax;
%dw 1.0
%output application/json
---
(payload.value.id) joinBy " or id eq "
and I get this as payload;
{
"@odata.context": "https://test.service.com/services/repo/v1/odata/$metadata#Incident",
"value": [
{
"id": "7001fc4a-8c8d-43f5-abc7-666666cbdd63",
"createDate": "2022-01-24T16:47:22Z"
},
{
"id": "ff8aeb42-210c-49d7-aa25-12da825b6b89",
"createDate": "2022-01-24T19:35:06Z"
}
]
}
I want to retrieve only the Id's and add id eq or see below.
how ever my desire output need to be like this;
9001fc4a-8c8d-43f5-abc7-146945cbdd63 id eq or
ff8aeb42-210c-49d7-aa25-19da825b6b89 id eq or
88eb39ee-d8f7-462c-9b69-1d4a1e3bf994 id eq or
66af209d-7635-4f51-95fd-204e2faea223 id eq or
5b93cf0d-e397-4cea-914b-3842c3aa0847 id eq or
I have tried with replace /["]/ with "" and with alot of connectors only I dont get it done. In mule 4 it's just changing the to output text/plain and it removes al the quotes only mule 3 not.
Anyone experience with this.
Thanks for helping.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
