Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Create Option Set values via web api

(1) ShareShare
ReportReport
Posted on by 2,909

Hi All

Does anyone know how to insert multiple global optionset labels via web api?

{
  "OptionSetName": "doc_industrytypetest",
  "Label": {
      "LocalizedLabels": [
                {
                    "Label": "Aged Care",
                    "LanguageCode": 1033
                }
      ]
  }
}

I can create 1 at a time as above however if I try more than one:

{
  "OptionSetName": "doc_industrytypetest",
  "Label": {
      "LocalizedLabels": [
                {
                    "Label": "Aged Care",
                    "LanguageCode": 1033
                },
                {
                    "Label": "Air Conditioning",
                    "LanguageCode": 1033
                }
                ]

  }
}

I get the error:

Cannot add duplicate label to label dictionary.

  • GFManunta Profile Picture
    2 on at
    RE: Create Option Set values via web api

    I worked on the solution Anthony Clark worked on a year ago it was helpful to my activity.

    this is a partial screenshot of what I did yesterday 

    pastedimage1672493400139v1.png

    pastedimage1672493453135v2.png

  • GFManunta Profile Picture
    2 on at
    RE: Create Option Set values via web api

    @antc Don't you this article can help you ?

    www.linkedin.com/.../

    let me know

  • GFManunta Profile Picture
    2 on at
    RE: Create Option Set values via web api

    Dear Antony,

    thanks for sharing your solution I have the same issue and I would like to use Postman to generate additional global option set values 

    Can tell me how to use the postman $batch script? (I have to use it over 8 different languages :( )

    pastedimage1672087783229v1.png

  • antc Profile Picture
    2,909 on at
    RE: Create Option Set values via web api

    Hi Leo

    Thanks for the replies I appreciate them. I always new that you could set optionset value or let dynamics just sets it as you create each like it does when creating them in the UI.

    Regards

    Antony

  • LeoAlt Profile Picture
    16,331 Moderator on at
    RE: Create Option Set values via web api

    Hi partner,

    Thanks for your information

    And as I said, you should add different value for different options in this field.

    If my answer helped you, please mark my answer as verified :)

    Regards,

    Leo

  • Suggested answer
    antc Profile Picture
    2,909 on at
    RE: Create Option Set values via web api

    You have to use batch here is a postman screenshot inserting label and value into global option set.

    pastedimage1595887662754v1.png

  • LeoAlt Profile Picture
    16,331 Moderator on at
    RE: Create Option Set values via web api

    Hi partner,

    Options set labels need values to correspond to it, so you need to add "Value" also for your new label.

    pastedimage1595815254098v1.png

    And the value should be number.

    Regards,

    Leo

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 32 Super User 2025 Season 1

#2
Sahra Profile Picture

Sahra 21

#3
Zain Mehmood Profile Picture

Zain Mehmood 15 Moderator

Overall leaderboard

Product updates

Dynamics 365 release plans