Graph API - Get specific AD attribute

Hello,

First: Use Graph API from a form works great :+1:

But I don't find how to get a specific AD attribute ...
This is the query string in Graph Explorer => https://graph.microsoft.com/v1.0/users/jhon.doe@company.com?$select=employeeID

Is this also possible from a Plumsail form?

Thank you,

Daniël

Dear @danieljr,
Does this not work? - Populate SharePoint form fields with profile information — SharePoint forms

I can get some props / attributes (limited list - see screenshot), but not employeeID or other Azure AD attributes ...

image

Dear @danieljr,
You can try manually selecting what properties to retrieve:

var user = fd.field('Person').value;
graph.users.getById(user.EntityData.Email).select('displayName','givenName')().then(function(props){
    console.log(props);
});

Yes, thank you, but this returns only a limited set of properties ( businessPhones, displayName, givenName, id, jobTitle, mail, mobilePhone, officeLocation, preferredLanguage, surname, userPrincipalName).

To return an alternative property set, you must specify the desired set of user properties using the OData $select query parameter. For example, to return postalCode, you would use the add the following to your query $select=postalCode

Is this also possible from a plumsail form? I can't find how ...

Dear @danieljr,
That's why I am saying for you to try select(), like in my example above, it achieves the same result.

Sorry, my mistake - the select() works great!

Thank you!

Daniël

1 Like