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 :
Customer experience | Sales, Customer Insights,...
Answered

Regarding Option Set

(0) ShareShare
ReportReport
Posted on by 104

I want to create new option set values dynamically, Is there any approach for that

I tried to use addOption(obj) method but dynamically created option are only available in UI side and Database couldn't add new created options

I have the same question (0)
  • Verified answer
    meelamri Profile Picture
    13,218 User Group Leader on at

    Hello,

    You can create a single line of text field and implement a PCF control to display the text field as an option Set.

    Another option is to use a webressource for the rendering, and you will store the selected value as a single line of text.

  • vashti hatami Profile Picture
    40 on at

    hi

    you can use this JS code:

    var low = {value : 100000000, text : "Low"};

       var medium = {value : 100000001, text : "Medium"};

       var high = {value : 100000002, text : "High"};

       var pickList = Xrm.Page.getControl("control_name");

       var options = pickList.getOptions();

       for (var i = 0; i < options.length; i++)

           pickList.removeOption(options[i].value);

       pickList.addOption(low);

       pickList.addOption(medium);

       pickList.addOption(high);

  • Pradnya Wankhade Profile Picture
    104 on at

    Hi Thanks for responding on my post , can you please share any example so I can take as reference

  • Pradnya Wankhade Profile Picture
    104 on at

    I have tried same but, see all the added option are available on UI Side only In the database data couldn't added. Because of this getting error while storing the record

  • Suggested answer
    meelamri Profile Picture
    13,218 User Group Leader on at

    You can play with this PCF Control, try it.

    github.com/.../PCF-Controls

  • Pradnya Wankhade Profile Picture
    104 on at

    13457.Capture.PNG

    I got this error when I will choose the newly added option from Option Set

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 > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 162 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 134

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 55 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans