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 :
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.

I have the same question (0)
  • LeoAlt Profile Picture
    16,331 Moderator on at

    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

  • Suggested answer
    antc Profile Picture
    2,909 on at

    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

    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

  • antc Profile Picture
    2,909 on at

    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

  • GFManunta Profile Picture
    2 on at

    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

  • GFManunta Profile Picture
    2 on at

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

    www.linkedin.com/.../

    let me know

  • GFManunta Profile Picture
    2 on at

    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

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 > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
iampranjal Profile Picture

iampranjal 41

#2
Martin Dráb Profile Picture

Martin Dráb 36 Most Valuable Professional

#3
Satyam Prakash Profile Picture

Satyam Prakash 35

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans