Power Automate: Retrieve User Details
This post covers how to leverage SharePoint REST API to get user details from Power Automate using the Send an Http request to SharePoint
action.
Within a Power Automate flow follow the steps below to retrieve a user details.
Send an Http request to SharePoint
action renamed toGet Page Author Details
- Site Address: https://test.sharepoint.com
- Method: GET
- URI: _api/Web/GetUserById(14)
Here’s the output from the API:
Here’s the output from the API:
{
"d": {
"__metadata": {
"id": "https://contoso.sharepoint.com/sites/d-intranet-hub/_api/Web/GetUserById(14)",
"uri": "https://contoso.sharepoint.com/sites/d-intranet-hub/_api/Web/GetUserById(14)",
"type": "SP.User"
},
"Alerts": {
"__deferred": {
"uri": "https://contoso.sharepoint.com/sites/d-intranet-hub/_api/Web/GetUserById(14)/Alerts"
}
},
"Groups": {
"__deferred": {
"uri": "https://contoso.sharepoint.com/sites/d-intranet-hub/_api/Web/GetUserById(14)/Groups"
}
},
"Id": 14,
"IsHiddenInUI": false,
"LoginName": "i:0#.f|membership|srv_test@ppf.co.uk",
"Title": "SRV_test",
"PrincipalType": 1,
"Email": "SRV_test@ppf.co.uk",
"Expiration": "",
"IsEmailAuthenticationGuestUser": false,
"IsShareByEmailGuestUser": false,
"IsSiteAdmin": true,
"UserId": {
"__metadata": {
"type": "SP.UserIdInfo"
},
"NameId": "100320022e6dd3f5",
"NameIdIssuer": "urn:federation:microsoftonline"
},
"UserPrincipalName": "srv_test@ppf.co.uk"
}
}
Parse JSON
action renamed toParse JSON Author Details
- Content: body(‘Get_Page_Author_details’)
- Schema:
{
"type": "object",
"properties": {
"d": {
"type": "object",
"properties": {
"__metadata": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"uri": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"Alerts": {
"type": "object",
"properties": {
"__deferred": {
"type": "object",
"properties": {
"uri": {
"type": "string"
}
}
}
}
},
"Groups": {
"type": "object",
"properties": {
"__deferred": {
"type": "object",
"properties": {
"uri": {
"type": "string"
}
}
}
}
},
"Id": {
"type": "integer"
},
"IsHiddenInUI": {
"type": "boolean"
},
"LoginName": {
"type": "string"
},
"Title": {
"type": "string"
},
"PrincipalType": {
"type": "integer"
},
"Email": {
"type": "string"
},
"Expiration": {
"type": "string"
},
"IsEmailAuthenticationGuestUser": {
"type": "boolean"
},
"IsShareByEmailGuestUser": {
"type": "boolean"
},
"IsSiteAdmin": {
"type": "boolean"
},
"UserId": {
"type": "object",
"properties": {
"__metadata": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"NameId": {
"type": "string"
},
"NameIdIssuer": {
"type": "string"
}
}
},
"UserPrincipalName": {
"type": "string"
}
}
}
}
}
- Use Parsed User Details in any subsequent actions
To utilize the user details, refer to the parsed JSON:
body('Parse_JSON_Author_Details')?['d']?['LoginName']