web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Autofill a Field Based on Another Choice Field

(0) ShareShare
ReportReport
Posted on by 183

Hello, I have an entity called Prospect. In that entity, I have a field/column called Country (dropdown Choice field synced with Global Choice named 'Country'). Once the user selects the country from the list, there is another field called Affiliations which should show which countries are affiliated with that selected country.

I have the list of countries affiliated with each other based on The 27 Sub-Regions of the World - OBJECTIVE LISTS

For example, if I select United States in 'Country' field, 'Affiliations' field should show Canada, Australia, New Zealand, Great Britain, and Ireland.

1) Should 'Affiliations' field be synced with the same Global Choice 'Country'?

2) How can I accomplish this using JS? I know I can hard code it as below but it's obviously not optimal: 

var countriesAssocitions = {
//Afghanistan
  4: [139, 198],
//Albania
  8:[158],
//Algeria
  12: [17],
//American Samoa
  16: [155, 47],
//Andorra
  20: [32],
//Angola
  24: [140],
//Antigua and Barbuda
  28: [47],

  31: [21]
 //etc
 }

where every value on the left represents the index of a country from the global choice 'Country' and the indices on the right are those of the affiliated countries. \

Is this the right way to go about it or is there a better way such as creating an array for every group of affiliated countries (there are 27 groups)?

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    It looks like that that's the perfect usecase for the dependent optionset - www.crmanswers.net/.../dependent-option-set-manager.html

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 151 Super User 2026 Season 1

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 51 Most Valuable Professional

#3
NeerajPawar Profile Picture

NeerajPawar 42

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans