Case 1: I have a phone number like this:
I want to replace first number 0 by 84 and return new number like this 84912345670
Case 2: I have a list of phone number like this:
I want to replace first number 0 by 84 and return list separate by comma like this: 84912345670,84912345671,84912345672 (not have blank).
I think Function Node can help but I have a little knowledge about code, can you help me?
84. The expression might look like something similar to this:
For Case 2, can you please share how does the data structure look like? Are the numbers returned as a single item, or are they returned as multiple different items?
@harshil1712 Thanks for quick reply, could you send me a working workflow with case 1?
@harshil1712 Thanks for your clearly example, it’s simple but powerful and almost solve both case 1 and 2 for me. And my data like this
If use your code, only Number (mobile) show on result, I want to show all data on result, too. Could you give an example to do this?
In the Format Number node (Set node) toggle Keep Only Set to
false. This will return the data from the previous node as well. When it is set to
false it will return firstname, mobile, updated, as well as the formatted number.
That’s ok for the solution and not need to use case 2. Thank you so much!
I am happy that it solves your issue! Have fun!