Option 1: Look Up Table with Zapier Formatter, Zapier Tables or Google Sheet
If the formatting is strictly for a given country (eg: US). It makes sense to keep the values in a place like Google Sheet, Zapier Table and look up.
How to setup Formatter by Zapier to format US states to 2 code
- Create a step and use “Formatter by Zapier”
- For the Action event, select “Utilities”
- In Configure tab, under Transform, pick Lookup Table
- For the Lookup Key, pick the dynamic value from previous step, for the example below I’ve put New York.
- Under look up table, add all the states and 2 code format.
Limitations with using Formatter for state code formatting
- Works for a single country as it would be hard to maintain formatting for multiple countries.
- Requires an initial setup, you can leverage a Zapier table if multiple automations are relying on this formatting.
- If the input has any misspellings the look up will fail.



How to setup Zapier Table to format US states to 2 code
The approach is similar to lookup table in Formatter, instead of maintaining the data within the Formatter step we are creating a separate table leveraging Zapeir tables which then can we be used by any automation. It’s a database.
Steps:
- Navigate to Tables from Zapier dashboard
- Create a new table
- Either import data from a spreadsheet (csv, google sheet etc) or start blank
- If you are starting from blank, add the data manually
Setting up the table



Using the table in an automation


In Setup
- For the action pick Zapier Tables
- Make sure App is set to Zapier Tables
- Select “Find Record” note that for the state look up we only need one record on look up, Find Record returns one record at a time
In Configure
- Table ID – Select the table created earlier
- Filter count – Set to 1
- Look Up field – The field containing the full state name
- Lookup value – This should be from the trigger or previous action step, for the demo I have hardcoded it to New York
Limitations with using Zapier Table for state code formatting
- Works for a single country as it would be hard to maintain formatting for multiple countries.
- Requires an initial setup.
- If the input has any misspellings the look up will fail.
Option 2: Using AI (ChatGPT, OpenAI, Zapier AI)
Using any of the AI powered Actions, a prompt could take the input and format.
Limitations when using AI based actions
AI may sometimes not adhere to the prompt instructions. I expect the all major AI providers to have accurate information of US states, if the use case is to format US states, this method is fastest to implement.
