Skip to main content

Notifications

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 ?

  • Suggested answer
    Naveen Ganeshe Profile Picture
    3,393 User Group Leader on at
    RE: crm api optionset text

    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.

  • Suggested answer
    Pradeep Rai Profile Picture
    5,487 Super User 2025 Season 1 on at
    RE: crm api optionset text

    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.


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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 671 Super User 2025 Season 1

#2
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 167 Super User 2025 Season 1

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 138 Most Valuable Professional

Product updates

Dynamics 365 release plans