web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Answered

Sorting D365 Chart Labels by an Option Set Field

(0) ShareShare
ReportReport
Posted on by

Hello, 

I have the following chart: 

chart.PNG

I am trying to sort the labels of this chart (Identify, Process, etc.) in the order of the Case Stage. There is an option set field called "xyz_stage" which contains the correct order those labels should be in. I need to sort those labels by that field. Is there a way to do this using XML? I have already sorted the Y Axis of the chart in alphabetical order but I cannot figure out how to sort the labels. 

Thank you!

I have the same question (0)
  • Suggested answer
    Charan Raju C R Profile Picture
    7 Moderator on at

    Hi,

    Ordering of optionset labels in a chart is based on the optionset values. So, you can modify the optionset values of Case Stage field in ascending order they should appear in the chart.

    Example, Route Case option to appear first, set minimum integer value (say, 10000), Resolve to appear last, set larger integer value (say, 10009), and other optionset values according your requirement.


    - Charan

    Please mark as verified if the answer is useful.

  • Community Member Profile Picture
    on at

    Thank you so much Charan, that does work. The only issue I am experiencing is that I actually cannot manipulate the option set values without causing issues with existing components which rely on the option set values like charts, workflows, etc. What is the best way to go about this change? should I recreate the option set field, or can I just change the labels so the option set values are then in the correct order? thank you!

  • Suggested answer
    Charan Raju C R Profile Picture
    7 Moderator on at

    If your application is already live, do not change label, because it misleads existing data. Also do not change value, that will mess the data.

    There are two ways to fix this problem. You can choose whichever comfortable with you.


    1. Adding new options to existing field

        A. Add new optionset values and labels to existing field and patch this optionset field data to new labels
             Example, add suffix <old> to all the existing labels, and add new labels and values. Then patch data from old to new values. Rename existing 'Resolve' label to 'Resolve <old>' then patch data from 'Resolve <old>' to 'Resolve'.
        B. Look for the components (workflows, reports, plug-ins, javascript..) dependent on this optionset field and fix them with respect to new values added.
        C. Delete the old optionset values. Need to manually delete the old optionset values from all the environments.


    2. Creating new optionset field

        A. Create new optionset field with corrected value and label mappings
        B. Patch data in newly created optionset field from existing field
        C. Check if there are any dependencies on old optionset field (like charts, views, workflows) and replace with new field and values
        D. Check the source code (plugin, custom workflows, JavaScript, reports and other integrations) for old field dependencies and replace with new field and values



    - Charan

    Please mark as verified if the answer is useful.

  • Suggested answer
    dian74 Profile Picture
    2,477 Most Valuable Professional on at

    crmchartguy.com/.../

    PLEASE MARK VERIFIED IF HELPFUL

  • Community Member Profile Picture
    on at

    Thank you Charan! this helps a lot. I have made the update based on your advice

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 24 Super User 2025 Season 2

#2
TAHER Mehdi Profile Picture

TAHER Mehdi 14

#3
Fameeda Yaseen Profile Picture

Fameeda Yaseen 10

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans