Hi @Alexandre_Magno
, welcome to the community!
You can do this using expressions in n8n. Here’s an example workflow that uses a Set node to stimulate the data coming from your Webhook node and another Set node that removes two days from the date.
{
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
250,
300
]
},
{
"parameters": {
"values": {
"string": [
{
"name": "Date",
"value": "25/01/2020"
}
]
},
"options": {}
},
"name": "Set",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
450,
300
]
},
{
"parameters": {
"keepOnlySet": true,
"values": {
"string": [
{
"name": "Date",
"value": "={{$json[\"Date\"].split('/')[0]-2}}/{{$json[\"Date\"].split('/')[1]}}/{{$json[\"Date\"].split('/')[2]}}"
}
]
},
"options": {}
},
"name": "Set1",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
650,
300
]
}
],
"connections": {
"Start": {
"main": [
[
{
"node": "Set",
"type": "main",
"index": 0
}
]
]
},
"Set": {
"main": [
[
{
"node": "Set1",
"type": "main",
"index": 0
}
]
]
}
}
}
Instead of expressions, you can also use the Function node for a better implementation than the one shown in the example above. If you are running a self-hosted version of n8n, you can also use built-in and external modules for easier manipulation of data.
You can find some handy JS snippets to use with n8n here. Hope that helps! 