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 :
Microsoft Dynamics CRM (Archived)

Retrieve OptionSet Label using Odata query

(0) ShareShare
ReportReport
Posted on by

Hi guys

Do you know how to retrieve the label of the selected value in an option set using Odata?

I have this query

var ODATA_Set = "?$select=pwc_AircraftStatus,pwc_EventDate,pwc_EventType,
pwc_HighVizReportReqmnt,pwc_HighVizTransmitted,pwc_NextActionDue,
pwc_RealTimestatusofAircraft,StateCode,TicketNumber,Title
&$filter=(pwc_HighVizReportReqmnt/Value eq 117280000 
and pwc_HighVizTransmitted eq true) or 
pwc_EventDate ge datetime'2014-12-02T12:00:00' 
and StateCode/Value ne 2 and not substringof('test',Title)";

retrieveMultiple("IncidentSet", ODATA_Set, 
                  SetHighVizReport_DescriptionCaseQuery, 
                  QueryError, false);

But I only get the numeric Value of the selected option
Do you know how to get the label?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    You can't get that using Odata, for that you need to write a query to return metadata so you have to use execute method using SOAP, Check this post: http://himbap.com/blog/?p=752

    Thanks

  • gopi.royal999@gmail.com Profile Picture
    430 on at

    Hi, Check the below.

    http://mscrmtechie.blogspot.in/2015/11/retrieve-option-set-text-from-crm.html

    You need to add SDK.Metadata.js as reference.

    --

    Gopinath

  • Community Member Profile Picture
    on at

    Hi Thanks for your answer for I don't understand the code

    In this part:

    DK.Metadata.RetrieveAttribute(EntityLogicalName, AttributeLogicalName, "00000000-0000-0000-0000-000000000000", true,

    what does the "0000000-0000....." means? is the id of the option set or the value I'm looking for?

  • Suggested answer
    Sayhaitokumar Profile Picture
    7,042 on at

    Hi Alan,

    Follow the below blog you may get some idea

    365dynamicscrm.wordpress.com

  • gopi.royal999@gmail.com Profile Picture
    430 on at

    Hi,

    You can just pass the same 00000's. You will get the output.

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
AS-17030037-0 Profile Picture

AS-17030037-0 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans