I have client who wants to display an Opt-In Checkbox Field on all forms with the appropriate verbiage when one of the 28 EU countries (or Canada) is selected in the Country field. Using the visibility rules in the Forms UI is cumbersome when there are 29 choices. Using multi-select in the drop-down is error prone and it's time-consuming to create 29 "If Country is X, Display Y Choices".
Is there an easier way?
https://blog.teknkl.com/visibility-rules-contains-regex/
There are more than 28 countries subject to GDPR, though.
Wow! Thank you, Sandy! I had no idea. Wonder why they don't document it?
What makes you say there are more than 28 countries?
Is Gibraltar on your list? 'cuz if not, you haven't covered the extended GDPR subjects.
No, it's not. But then Gibraltar isn't in their country picklist either - probably because it's not really a country but a territory of Spain. Is there an "extended" list you can point me to?
probably because it's not really a country but a territory of Spain
Mmm, more complex than that. GI is a British Territory and is (pending Brexit implementation) EU because of the British connection. The connection to Spain is deeply cultural but currently not legal.
Anyway, if it's not in the list then not necessarily a problem, since people will (hopefully) choose GB or ES in the absence of a literal entry for Gibraltar. Still, Gibraltar has its own country code and when you're doing GeoIP, for example, you have to expect that CCs to come up.
Is there an "extended" list you can point me to?
We currently use this list of ISO 2-letter CCs. It aggressively tilts toward following GDPR, rather than trying to split hairs about whether a certain semi-independent territory has opted in or out.
{
"GDPR" : {
"core" : [
"AT",
"BE",
"BG",
"HR",
"CY",
"CZ",
"DK",
"EE",
"FI",
"FR",
"DE",
"GR",
"HU",
"IE",
"IT",
"LV",
"LT",
"LU",
"MT",
"NL",
"PL",
"PT",
"RO",
"SK",
"SI",
"ES",
"SE",
"GB"
],
"omr" : [ "GF", "GP", "MQ", "ME", "YT", "RE", "MF" ],
"special" : [ "GI", "AX" ],
"oct" : [
"PM",
"GL",
"BL",
"SX",
"AW",
"CW",
"WF",
"PF",
"NC",
"TF",
"AI",
"BM",
"IO",
"VG",
"KY",
"FK",
"MS",
"PN",
"SH",
"GS",
"TC"
],
"micro" : [ "AD", "LI", "MC", "SM", "VA" ],
"misc" : [ "JE", "GG" ]
}
}