Can the displayName property in the Organization object be an empty string?

asked 2023-01-17T05:27:01.9266667+00:00
Manoj Nityanand Deshpande 0 Reputation points Microsoft Employee

HI - We are using the graph api to call Organization object using tenant Id. We are mainly interested in the displayName property of that object. We wanted to know if it is always populated with a value or can be an empty string as well? Based on that we might have to change our logic to handle it.

Based on this article, [https://learn.microsoft.com/en-us/graph/api/resources/organization?view=graph-rest-1.0#properties - it seems to be not nullable (as its not mentioned as such), but can it be left empty?

Can you please let me know? Thanks!

Microsoft Graph Users API
Microsoft Graph Users API
A Microsoft API that allows you to build compelling app experiences based on users, their relationships with other users and groups, and the resources they access for example their mails, calendars, files, administrative roles, group memberships.
545 questions
Microsoft Graph SDK
Microsoft Graph SDK
A Microsoft software developer kit designed to simplify building high-quality, efficient, and resilient applications that access Microsoft Graph.
721 questions
No comments
{count} votes

2 answers

Sort by: Most helpful
  1. answered 2023-01-17T05:53:01.2866667+00:00
    sreejukg 9,166 Reputation points

    Basically, in your application, It is always recommended to use the id field that uniquely identifies the tenant.

    The displayname, as the name indicates, it is for just displaying. Also, the display name property can be nullable, as per the specifications. As you can see, for not nullable, the documentation specifies it clearly.

    See the specifications for the display name propertyUser's image

    See the specification for another property that is not nullable. User's image

    So I recommend you to work with ID or the verifiedDomains field in your business logic to uniquely identify the organization.

    Hope this helps

    No comments

  2. answered 2023-01-17T06:55:27.1366667+00:00
    Carl Zhao_MSFT 17,976 Reputation points Microsoft Employee

    Hi @Manoj Nityanand Deshpande

    According to my tests, when you create a tenant, the displayName property must be populated with a value, it cannot be set to an empty string.

    User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".