Hi, I am trying to get the selected item text from an option set. I got this error: "The given key was not present in the dictionary"
contact.FormattedValues["registrationcategory"].ToString()
*This post is locked for comments
Hi,
Aric could be right also. just change the prefix in the provided code if he is right.
Are you possibly missing the prefix from the attribute name?
contact.FormattedValues["new_registrationcategory"].ToString()
Hi,
i assumed you include this attribute when you select the record.
Next, check is the optionset value contain data for the selected record?
if no, you might need to put a checking
example :
if (contact.Attributes.Contains("registrationcategory"))
{
optionset = contact.FormattedValues["registrationcategory"].ToString();
}
Reason :
if the attribute does not contain data, when you select the record, although you included the attribute, but you will not see the attribute.
I am getting this value from somewhere else
Hi,
did you include this attribute when you select the record?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156