I want to clean up the phone numbers from my api


Recommended Posts

Hello community, I would like to clean up the phone numbers I get from my api. I would like to do the cleanup in a code node to test my JavaScript knowledge. But I can’t get any further. I have now written the following script and always get only as a result: null. I’ve already tried what happens when I run the first line through: let phoneNumber = “09585/86756757” || ‘’; Replace.
And there I got the phone number cleaned up as a result. But how do I get the phone number of my API in there?

Link to post
Share on other sites

Cleaning up phone numbers from your API sounds like a great idea. One approach you can try is normalizing the phone numbers to a consistent format. You could remove any special characters like dashes or parentheses, and make sure all numbers have the same country code if needed. If you're dealing with international numbers, using a library that supports phone number validation and formatting, like Google's libphonenumber, can really help. Also, verifying phone numbers during registration or sign-up can help weed out incorrect or fake numbers. If you’re interested, you could look into tools like verification phone number for an extra layer of accuracy.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...