How can I split a phone number into different items in the Code Node?

I want to split a phone number (“telephone”: “+5541912345678”,) in the following pattern:
“ddi”: “+55”,
“ddd”: “41”,
“digit”: “9”,
“phone”: “12345678”

How can I do that with the Code Node?

  • n8n version: 0.200.1

I found a way to do it, I’m pretty sure this isn’t efficient, but I have no idea how to code further than this haha

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.