Hello, my company is updating our state/country integration values in Salesforce, so I need to update all our forms to have the new country codes instead of name values. I've gotten the API to work to update the country field and our opt-in checkbox visibility rules, but I'm struggling with the State visibility rule.
I'm grabbing the rules from a GET call and just changing the "United States" and "Canada" to "US" and "CA" the way I did for the others, but I'm consistently getting a 709 error that reads "Field of type radio buttons, checkboxes and select should have picklist values." Has anyone worked with updating form visibility rules via the API? Any idea what's wrong with the message body below? I'm identifying the "picklistFilterValues" , and they're all already entered as values in the State field.
{
"rules":[
{
"subjectField":"Country",
"operator":"is",
"values":[
"US"
],
"altLabel":"State",
"picklistFilterValues":[
{
"label":"AK",
"value":"AK"
},
{
"label":"AL",
"value":"AL"
},
{
"label":"AR",
"value":"AR"
},
{
"label":"AZ",
"value":"AZ"
},
{
"label":"CA",
"value":"CA"
},
{
"label":"CO",
"value":"CO"
},
{
"label":"CT",
"value":"CT"
},
{
"label":"DC",
"value":"DC"
},
{
"label":"DE",
"value":"DE"
},
{
"label":"FL",
"value":"FL"
},
{
"label":"GA",
"value":"GA"
},
{
"label":"HI",
"value":"HI"
},
{
"label":"IA",
"value":"IA"
},
{
"label":"ID",
"value":"ID"
},
{
"label":"IL",
"value":"IL"
},
{
"label":"IN",
"value":"IN"
},
{
"label":"KS",
"value":"KS"
},
{
"label":"KY",
"value":"KY"
},
{
"label":"LA",
"value":"LA"
},
{
"label":"MA",
"value":"MA"
},
{
"label":"MD",
"value":"MD"
},
{
"label":"ME",
"value":"ME"
},
{
"label":"MI",
"value":"MI"
},
{
"label":"MN",
"value":"MN"
},
{
"label":"MO",
"value":"MO"
},
{
"label":"MS",
"value":"MS"
},
{
"label":"MT",
"value":"MT"
},
{
"label":"NC",
"value":"NC"
},
{
"label":"ND",
"value":"ND"
},
{
"label":"NE",
"value":"NE"
},
{
"label":"NH",
"value":"NH"
},
{
"label":"NJ",
"value":"NJ"
},
{
"label":"NM",
"value":"NM"
},
{
"label":"NV",
"value":"NV"
},
{
"label":"NY",
"value":"NY"
},
{
"label":"OH",
"value":"OH"
},
{
"label":"OK",
"value":"OK"
},
{
"label":"OR",
"value":"OR"
},
{
"label":"PA",
"value":"PA"
},
{
"label":"RI",
"value":"RI"
},
{
"label":"SC",
"value":"SC"
},
{
"label":"SD",
"value":"SD"
},
{
"label":"TN",
"value":"TN"
},
{
"label":"TX",
"value":"TX"
},
{
"label":"UT",
"value":"UT"
},
{
"label":"VA",
"value":"VA"
},
{
"label":"VT",
"value":"VT"
},
{
"label":"WA",
"value":"WA"
},
{
"label":"WI",
"value":"WI"
},
{
"label":"WV",
"value":"WV"
},
{
"label":"WY",
"value":"WY"
}
]
},
{
"subjectField":"Country",
"operator":"is",
"values":[
"CA"
],
"altLabel":"Province",
"picklistFilterValues":[
{
"label":"Alberta",
"value":"AB"
},
{
"label":"British Columbia",
"value":"BC"
},
{
"label":"Manitoba",
"value":"MB"
},
{
"label":"New Brunswick",
"value":"NB"
},
{
"label":"Newfoundland and Labrador",
"value":"NL"
},
{
"label":"Northwest Territories",
"value":"NT"
},
{
"label":"Nova Scotia",
"value":"NS"
},
{
"label":"Nunavut",
"value":"NU"
},
{
"label":"Ontario",
"value":"ON"
},
{
"label":"Prince Edward Island",
"value":"PE"
},
{
"label":"Quebec",
"value":"QC"
},
{
"label":"Saskatchewan",
"value":"SK"
},
{
"label":"Yukon",
"value":"YT"
}
]
}
],
"ruleType":"show"
}
I've spent the past couple hours stuck on this, so any help would be really appreciated. Thank you!
Make you a deal, highlight that as actual JSON (JS in the syntax highlighter) and I'll figure it out for you.
Good point, Sanford, I've both changed the syntax and ran my original rules through a JSON formatter to get it a bit more legible.
Can I see your form on a page as well (I will grab the current form descriptor from there)?
Here's an example: https://www.snowflake.com/resource/cloud-data-warehousing-dummies/