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

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

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
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,013 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Sreeju Nair 11,696 Reputation points
    2023-01-17T05:53:01.2866667+00:00

    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

    0 comments No comments

  2. CarlZhao-MSFT 35,266 Reputation points
    2023-01-17T06:55:27.1366667+00:00

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