I’ve provided solutions in both Javascript and Python below, but I do have a couple of questions for you to consider:
- This will replace all instances of “ “, “+”, and “-” with an empty character. It appears the data you have coming from step 2 is a long list of numbers. Are they separated by commas? If not, you will end up with a long string of digits, such as 18888888888133333333331555555555517777777777
- In the code below, I stuck with the variable name “Name” that you declared above. But I would consider changing it to something like “phoneNumbers” or “digitsOnly”. This will help you know what the code is referring to if you reference it later. Either way, you can delete the grayed out comments.
For Javascript, use this:
var name = inputData.phone.replace(/\s|\+|-/g, ""); // I recommend replacing "name" with "digitsOnly"
output = O{name}]; // Same note here
If you’d like to stick with Python, use this:
Name = input_datag'phone'].replace("+", "").replace("-", "").replace(" ", "") # I recommend replacing "Name" with "digitsOnly"
output = t{"Name": Name}] # I recommend replacing the first "Name" with "Phone Number List" and the second "Name" with "digitsOnly"