microsoftgraph / msgraph-sdk-php

Microsoft Graph Library for PHP.
Other
578 stars 144 forks source link

Question: How to select field on users ? #1442

Closed Arkantium closed 10 months ago

Arkantium commented 10 months ago

I need to get the deparment of my user, how to achieve this ? I have try that, but if i try department is null and st not return the field

$this->graphServiceClient = new GraphServiceClient($tokenRequestContext);

     $requestConfiguration = new UsersRequestBuilderGetRequestConfiguration();
            $queryParameters = new UsersRequestBuilderGetQueryParameters();

            $queryParameters->select = ["displayName", "userPrincipalName", "st"];
            $requestConfiguration->queryParameters = $queryParameters;

            $usersResponse = $this->graphServiceClient->users()
                ->get($requestConfiguration)
                ->wait();

           dd($usersResponse);
Ndiritu commented 10 months ago

@Arkantium have you tried this while adding department to the select?

$queryParameters->select = ["displayName", "userPrincipalName", "department"];
microsoft-github-policy-service[bot] commented 10 months ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.