Hi,
Below is the sample code to read Picklist value (i.e., OptionSet Value) in CRM 2011
if (context.InputParameters.Contains(“Target”) && context.InputParameters[“Target”] isEntity)
{
currEntity = (Entity)context.InputParameters[“Target”];
}
int statusValue = -1;
string statusText=string.empty;
if (currEntity .Attributes.Contains(“statecode”))
{
OptionSetValue optionState = currEntity .Attributes[“statecode”] as OptionSetValue;
statusValue = optionTimesheetState.Value;
statusText = optionTimesheetState.Text;
}
Hope it helps 🙂

![[Step by Step] Configure and run 'Pipelines in Power Platform'](https://rajeevpentyala.com/wp-content/uploads/2024/08/image.png)
![[Beginners] Power Fx: ShowColumns, AddColumns, RenameColumns and DropColumns](https://rajeevpentyala.com/wp-content/uploads/2024/04/record-ezgif.com-video-to-gif-converter-1-2.gif)
Leave a reply to Debbie Cancel reply