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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

crm api optionset text

(0) ShareShare
ReportReport
Posted on by

Hi,

I am creating a record through api.

For optionset field, we have to specify the appropriate optionset values. 

But I am getting data from the source as text only. I know we cannot specify the optionset text while consuming the api. Is any work around there to achieve ?

I have the same question (0)
  • Suggested answer
    Pradeep Rai Profile Picture
    5,489 Moderator on at

    Hi,

    You can write a metadata retrieving code to get option set value and text as described in below link:

    https://staturestack.wordpress.com/2020/09/24/retrieve-optionset-metadata-using-javascript-dynamics-365/

    Now the logic will be once you get the text value then retrieving the option set metadata values and after comparing the values you can set the numeric values for option set.


  • Suggested answer
    Naveen Ganeshe Profile Picture
    3,397 User Group Leader on at

    Hello Anandhcrm,

    You will need to first retrieve the optionset metadata from CRM to get the mapping between the optionset text values and their option values.

    Once you have this mapping, you can then replace the text values with their option values and create the record through the API.

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

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

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 83 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

#3
#ManoVerse Profile Picture

#ManoVerse 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans