Howdy Zapier Friends! We are back with another Formatter by Zapier overview. This time we will talk about Extract Number and Extract Phone Number.
Recall that the Formatter by Zapier app is the main tool you can use to edit data sent to Zapier. Almost any basic formatting option is possible, but even saying something as generous as that is selling short all of the possibilities that this app offers users!
Keep in mind that when you use the Extract transforms in this app, Zapier will only ever pull the first item we find that matches the Extract you are using. If you need to cut strings in multiple parts and access that data, you may need to use our Split Text transforms.
For very advanced users there also exists the Code by Zapier app (which supports Python and Node.js), or the Extract Pattern transform in Formatter by Zapier (which lets you leverage Regular Expressions) but those are different topics for the future!
Formatter by Zapier: Extract Phone Number
This option can be found at:
Formatter by Zapier — Text — Extract Phone Number
What It Looks Like
At a very high level, all apps are kind of the same in Zapier. Sure, they touch different APIs to pull in unique resources from each service they link to, but when Zapier is processing the responses from our requests, we just interact with it as generic data sent in (usually) a JSON format.
Phone numbers can be thought to be similar in that they follow a precise format as well.
Using the Extract Phone Number function, Zapier will attempt to pluck out the first phone number in the data that is given to it as input.
Consider the following:
From this input, Zapier could easily extract the first number, but not the second.
Also take a look at the options below the input:
You likely will have the most success by just leaving this setting alone, but if you do find your input is sometimes not being parsed correctly but the number looks fine to you, try to change this setting to test out different behaviors to see if one works better for your data.
We can see in the output, Zapier properly grabbed the first number:
Formatter by Zapier: Extract Number
This option can be found at:
Formatter by Zapier — Text — Extract Number
What It Looks Like
How to Use It
Do you have a chunk of text that has a number in it that you want?
Perfect, we have just the tool for you in the Extract Number transform!
In this step, literally the only input you can provide is the content from which you would like us to extract the number:
Remember once more that we will only extract the first item:
Keep in mind that you can use Formatter by Zapier steps in tandem as well. For any string you want to grab that our “Extract” transforms will not pull, you could use a Split Text step first to separate the data and then use an “Extract” step to access the additional strings. In some cases, Split Text will do ALL of the work for you!
Consider the following:
This is mostly useful for parsing data that has a known and consistent format, but for everything else, you can use the “Extract” series of transformations to break apart your data!
Wrapping Up
This has been a brief look at our Formatter's Extract Number and Extract Phone Numbers features. Next up in the Formatter Features series we'll be taking a look at Pick from List and how you can use this Formatter feature in your Zaps. Until next time!