I’m building a automation that reads a phone number from an incoming webhook and searches for a row in a Google Sheet that contains that phone number so I can have an AI agent on the phone with a caller read their name (gathered from that row) as part of a greeting.
When the number comes in from the webhook it’s in the following format +15554443333 my client has numbers in their Google Sheet formatted as 555-444-3333, +1 555-444-3333 or (555) 444-3333.
I need to convert the number coming in from the webhook in the +15554443333 format into the other three formats and instantiate variables with those formats so I can use them in the Google Sheets search rows module.
The best idea would be to clean up the data coming into the said webhook
using tools you would be able to clean the data for it to just be a 10 digit phone number, remove the “+” or anything else, then if the number has a “1” in the beginning it would be removed as well
after that your number should look like ‘5554443333’
then you would be able to cleanly parse through that information to get the exact formats that you desire
The Parse a Phone number module is what you are looking for. It takes phone numbers in many different formats and returns them in several standardized formats, the I international one is then most widely used.