Skip to main content
Best answer

Extracting last letters of a word using the Formatter


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.

 

View original
Did this topic help you find an answer to your question?

5 replies

Troy Tessalone
Forum|alt.badge.img+14
  • Zapier Expert
  • 31305 replies
  • 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
Forum|alt.badge.img+14

@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
Forum|alt.badge.img+14

@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
Forum|alt.badge.img+14

@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

Reply