Skip to main content
Best answer

Extracting last letters of a word using the Formatter

  • May 1, 2021
  • 5 replies
  • 2271 views

Angelo Spiler

The Truncate function returns the first letters of a word etc. But we need the last two letters of a string (ZIP-codes) to be returned. I guess we need a spreadsheet-like formula in zapier that returns text. Who can help?

 

Example: when people submit:

1074XP : we want as a return value: XP

1055 DR: we want as a return value: DR

5678   XX: we want as a return value: XX

 

Best answer by Troy Tessalone

Hi @Angelo Spiler 

Give this trick a try with the Formatter > Text > Truncate option

TIP: Set the Skip Characters to -2 which will return characters from the end of (right side) of the string.

See example step configured below along with the output.

 

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

5 replies

Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • Answer
  • May 1, 2021

Hi @Angelo Spiler 

Give this trick a try with the Formatter > Text > Truncate option

TIP: Set the Skip Characters to -2 which will return characters from the end of (right side) of the string.

See example step configured below along with the output.

 


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • May 1, 2021

@Angelo Spiler

FYI: There is a Formatter > Math > Spreadsheet Style Formula option: https://zapier.com/help/create/format/understand-spreadsheet-style-formula-functions


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • May 1, 2021

@Angelo Spiler 

Here’s how to use a Code step with JavaScript to get the last 2 characters from a string

 


Angelo Spiler


Excellent. First solution works fine and is sufficient. Thanks! Is there a place where I can find tricks like minus 2 etc.? The help-information of Zapier website is rather elementary.


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • May 1, 2021

@Angelo Spiler 

Best shot at finding tricks/tips is these places:

  1. Zapier Community: https://community.zapier.com/
  2. Zapier Blog: https://zapier.com/blog/
  3. Zapier App Help Articles
  4. Open a Ticket with Zapier Support: https://zapier.com/app/get-help
  5. GSearches on the topic