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,...
Suggested Answer

Negative OptionSet value

(0) ShareShare
ReportReport
Posted on by 5

Hello, 

I have a question regarding OptionSet Value

We are using API to connect Dynamics and importing data to our system,

It is obvious that OptionSet value should be a positive number but we received -1 as OptionSet Value.

We know it is an invalid value and it should be ignored and consider as null.

My question is,

where this value comes from . how it was populated. is there and special scenario that Dynamic fill option set with -1

I appreciate your help in advance

I have the same question (0)
  • Guido Preite Profile Picture
    54,086 Moderator on at

    from what you are describing to me looks like you are connecting to a custom API and not directly to Dynamics API.

    Probably the custom API returns -1 under certain conditions, afaik it's not possible to receive a negative number for optionset values when using the OOB Dynamics API.

  • Suggested answer
    tanay@D365 Profile Picture
    45 on at

    Can you please check if the CRM table contains the value as -1 in the Database ?  You can use SQL4CDS in XRM Toolbox www.xrmtoolbox.com/.../

    you can run a  select query on the table in question and check what value is stored there (I will be surprised to see a -1 value stored as Optionsetvalue in CRM though)

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

    Hello.

    Please check the API which is returning the -1 value. You should check if optionset value is not set or null

  • Edwin VC Profile Picture
    8 on at
    I know this is an older post already, but I currently experience the same issue and it causes a problem when using Custom Forms showing a 'Invalid Data from Network' message.
     
    I found that indeed the OptionSet can have a negative '-1' value based the user selecting/reverting to the '--select--' option in the default OptionSet Control, presumably when a user tries to clear the selected value. But the '--select--' is not part of the metadata configuration and there is no setting that will allow us to disable the '--select--' option.
     
    In the end this does not result in a critical issue for this implementation, everything works as expected, only the message is shown when a Custom Form with a grid (gallery) is displayed. The value in the gallery showing the value for the OptionSet as a text value is blank as to be expected. Setting the OptionSet value to an actual OptionSet value will resolve the issue. Using a workflow to 'clear' the value (value is null) will also resolve the issue.
     
    If anybody has a suggestion on how to suppress the 'Invalid Data from Network' message without difficult work-arounds that would complicate future maintenance let me know.

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
11manish Profile Picture

11manish 156

#2
ManoVerse Profile Picture

ManoVerse 153 Super User 2026 Season 1

#3
Zhilan Profile Picture

Zhilan 49

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans