Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Getting option set text from expanded entity using Web API

(0) ShareShare
ReportReport
Posted on by 40

I know I use the Prefer: odata.include-annotations="OData.Community.Display.V1.FormattedValue"   to get labels from entity option sets. How do I do this for expanded entities?

Example:

10.150.150.122/.../jobopportunities$select=name,positiontitle,account_value,list_value,reportto,startdate&$filter=statecode eq 0&$expand=account($select=sector)

How do I get the sector label instead of or as well as getting the sector value?

*This post is locked for comments

  • NeilN Profile Picture
    NeilN 40 on at
    RE: Getting option set text from expanded entity using Web API

    Thanks for the answer and the link. Wanted to make sure it wasn't anything that would change with different CRM deployments.

  • Suggested answer
    Arun Vinoth Profile Picture
    Arun Vinoth 11,615 on at
    RE: Getting option set text from expanded entity using Web API

    x002e is hexadecimal equivalent of . (dot)

    It’s equivalent of aa_sector. The prefix & attribute name is separated like that. Or alias.attributename.

    [View:https://stackoverflow.com/q/45206677/7920473]

  • NeilN Profile Picture
    NeilN 40 on at
    RE: Getting option set text from expanded entity using Web API

    Thank you, Andrew.  One question. I get key names starting with "aa_x002e_sector". I get that "aa" is an alias but where is "x002e" coming from?

  • Verified answer
    a33ik Profile Picture
    a33ik 84,325 Most Valuable Professional on at
    RE: Getting option set text from expanded entity using Web API

    Hello Neil,

    You should try fetchxml approach instead - www.powerobjects.com/.../using-fetchxml-with-the-new-dynamics-web-api

    In this case all labels should be returned properly.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,432 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans