Use Power Automate to Retrieve Employee Details from Excel
Question details
The user needs to retrieve missing employee information (such as IDs or email addresses) from Microsoft Entra ID or Graph API using existing data stored in an Excel table.

- Product
- Microsoft Excel / Power Automate
- Device & OS
- not provided
- Scenario
- Automating the retrieval and matching of directory data to fill in missing employee records within an Excel worksheet.
- Observed behavior
- The user wants to pull Entra ID details into an Excel table but encountered an issue where the flow returned raw code instead of the parsed text information.
Ensure your Excel file is formatted as a formal Table (Insert > Table) and saved in a cloud location like OneDrive for Business or SharePoint so Power Automate can securely access it.
Create a Cloud Flow with Microsoft Graph API
Use Power Automate to read the Excel table and query Microsoft Graph for the missing employee directory data to update your records.
By utilizing the Microsoft Graph API within a cloud flow, you can look up specific userPrincipalName or ID values in your organization's directory and automatically write those missing details back to your original spreadsheet.
Add the 'List rows present in a table' action in Power Automate to retrieve your existing employee IDs or emails from the cloud-saved Excel file.
Add an 'HTTP request' action pointing to 'https://graph.microsoft.com/v1.0/users' to fetch the directory data from Entra ID.
To fix issues where raw code is returned, add a 'Parse JSON' action to format the Graph API response. Then, use an 'Apply to each' loop to process the returned value array.
Inside the loop, match the userPrincipalName or ID with your Excel data, and use the 'Update a row' action to fill in the missing employee information in your spreadsheet.

Manage Your Spreadsheet Data seamlessly with WPS Office
While Power Automate and Microsoft Graph are heavily tied to the Microsoft ecosystem for automated directory queries, you can easily manage, format, and prepare your foundational employee data tables using WPS Office. It provides a lightweight, highly compatible alternative to Microsoft Excel for all your offline and daily data management needs.

Frequently Asked Questions
Why does my Power Automate HTTP request return raw code instead of text information?
This happens when the JSON response from Microsoft Graph is not parsed. Use the 'Parse JSON' action in Power Automate and provide the schema for the Graph API response to convert the raw API code into usable dynamic text tokens.
Can I update an existing Excel file instead of creating a new one?
Yes, you can use the 'Update a row' action in Power Automate. You will need a unique Key Column (like Employee ID or Email address) in your Excel Table to identify exactly which row to update with the newly retrieved Entra ID data.
Does the Excel file need to be saved in a specific location for Power Automate to read it?
Yes. To use the 'List rows present in a table' action successfully, the Excel file must be stored in a supported cloud location accessible by Power Automate, such as OneDrive for Business or a SharePoint Document Library.
Can I use Power Apps instead of Power Automate for this task?
While Power Apps can be used to build a custom interface to manually view and update individual Excel records, Power Automate is highly recommended for bulk retrieving and updating missing data automatically without needing to build or maintain an app UI.




