Formatter Features: extracting numbers + phone numbers

  • 15 September 2021
  • 0 replies
  • 1645 views
Formatter Features: extracting numbers + phone numbers
Userlevel 4
Badge +7

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

5943a22746570661e7af92165473e44e.png

What It Looks Like

2421b7c7cbd26b281f61f1a498c7e842.png

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:

8c6f6bb5201bef35cbc96f67ca40f41e.png

From this input, Zapier could easily extract the first number, but not the second.  

Also take a look at the options below the input:

987407b54e534f9ebc7a02c40f7d2fbd.png

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:

151a60df1d60c390a379a63b359c6665.png

Formatter by Zapier: Extract Number

This option can be found at:
Formatter by Zapier — Text — Extract Number

5fcac14c3050f36c7b5aa43b2285f474.png

What It Looks Like

32ead2c34a1f9d06ac31c5c9401834df.png

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:

b9f08035c663b122fd0bab698f1775bf.png

Remember once more that we will only extract the first item:

 

f549595a6b0027bb5c9d435f6c75ef2c.png

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:

 

6111a16bfc2d37715512a34a6b646d4e.png

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!


0 replies

Be the first to reply!

Reply