If you've noticed, the accounts and contacts module of your CRM uses single-line fields to capture address information, such as billing city, billing state, and billing country. Using single-line fields can lead users to enter incomplete or misspelled data. For example, users might enter "NYC" instead of "New York City". One effective way to address this issue is to use picklist fields instead. However, the current CRM edition does not allow changes to the field types of existing fields or the deletion of standard fields to create new fields with the same name.
Additionally, the "Copy Address" button does not auto-populate custom fields from billing to shipping addresses, which adds to the issue. Nevertheless, we have a solution. Our low-code tools can address these unique business needs.
All you need to do is add custom picklist fields for the city, state, and country. Next, use functions to update the standard address fields whenever their corresponding picklist selections are added or modified. This ensures that the address data in both the single line and picklist fields are in sync, allowing you to copy addresses from billing to shipping at the click of a button. Read on to learn more.
Permissions and availability
- Users with the Modules Customization permission can add custom fields.
- Users with the Manage Automation permission can create and update workflow rules.
- Users with the Manage Extensibility permission can create custom functions.
- Users with the Manage Sandbox permission can manage the sandbox.
Requirements
- Add Picklist fields in the Accounts module. These fields will capture billing city, state, and country instead of single-line fields. Learn more
- Create a workflow rule for the Accounts module that triggers upon creating or modifying an account. Learn more
- Write a custom Deluge function and link it up with the workflow rule. Learn more
- Test the workflow rule in a sandbox before deploying it to your production environment. Learn more
Add custom fields
The first step is adding the custom picklist fields to the Accounts module.
- Navigate to Setup > Customization > Modules and Fields.
- Click the Accounts module to open the layout editor.
- Drag and drop three Pick List fields from the New Fields tray to the desired section of the layout.
- Name the picklist fields (e.g., "City", "State", and "Country"), enter the options, and define their properties as required.
- Once you have finished, click Save and Close.
Create a workflow rule
The next step is creating a workflow rule in your CRM account.
- Navigate to Setup > Workflow Rules > +Create Rule.
- Select Accounts from the module dropdown list.
- Provide a name for the rule. For example: "Update address information".
- Add a description (optional) and then click Next.
- In the Execute this workflow rule based on section, do the following:
- Choose Record Action, then select Create or Edit from the dropdown.
- Check the Repeat this workflow whenever an account is edited option.
- Click Next.
- In the Which accounts would you like to apply the rule to? section, select All Accounts, then click Next.
- Under Instant Actions, select Function and Write your own.
- Provide a Name for the function, as well as a description, if necessary.
- On the Deluge Script Editor, do the following:
- Copy and paste the code given below.
- Click Edit Arguments.
- Choose Accounts - Account Id, and name it acctId.
- Click the + icon to add more arguments.
- Choose Accounts - City, and name it city.
- Click the + icon to add more arguments.
- Choose Accounts - State, and name it state.
- Click the + icon to add more arguments.
- Choose Accounts - Country, name it country, then click Save.
- Click Save & Execute script.
- Click Save on the workflow rule page.
The code
mp = map();
mp.put("Billing_City",city);
mp.put("Billing_State",state);
mp.put("Billing_Country",country);
upd = zoho.crm.updateRecord("Accounts",acctId,mp);
info upd;
Notes
- Make sure to use the accurate API names for their corresponding fields in the code snippet (e.g., "Billing City"). Learn more
- The code above is an example of how to create and use picklist fields for city, state, and country instead of using the standard single-line fields to ensure consistency and avoid irrelevant data entries in your CRM. You can use this code to update fields in any other module, such as Contacts, by modifying the module name and parameters.
Tip
- Configure and test the function in a sandbox to ensure that further development doesn't disrupt your production environment.
Test the solution
- Navigate to Accounts > +Create Account.
- On the Account Details page, enter the account information, including city, state, and country, from their picklist fields, then click Save.
The workflow rule will be triggered. - Check whether the city, state, and country information was updated in the account's corresponding standard single-line fields.
Did you find this useful? Try it out and let us know how it works. Share this with your team if they'd benefit from it! If you have questions, please don't hesitate to contact us.
More info
- ModuleAccounts
- Trigger PointWorkflow Rule
- EditionEnterprise and above
- ComplexityMedium
- Implementation Time30 minutes

Looking for a custom solution?
Contact us, we will help enhance your productivity at lightning speed.
SUBMIT REQUEST