Skip to main content

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

 

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.

 


@Angelo Spiler

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


@Angelo Spiler 

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

 



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.


@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