cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Error Handling for capturing Office 365 user Profile and adding a record into Excel

Hi,

We have an employee table that has over 1,000 records.  Many of the people no longer work here but we still need a list of them to be captured in our flow for historical reporting purposes.  My first action is called "When an item is modified in SQL Server" where I link to the employee table.  My next step is to get user profile (v2) where I capture the Office 365 id by linking it to the email address column in our employee table.  Since many people left 1-5 years ago, they have no office 365 email/id and the flow fails for them.  I get a status 404  error listed below.

{
"error": {
"code": "ResourceNotFound",
"message": "User not found",
 
The flow still captures all active employees but I would like to create some sort of error handling that will simply allow all past employees with no Office 365 id to be sent to my spreadsheet anyway.  I was looking at conditional logic but can't seem to figure this out.  Any thoughts?
Thanks,
CW
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Error Handling for capturing Office 365 user Profile and adding a record into Excel

Hi @Anonymous ,

 

Do you want to collect information about employees who do not have an O365 email/id?

 

You could try to configure Add a row into a table action with Configure run after. "Add a row into a table" action is executed only when "Get user profile (v2)” action fails.

 

I use Button as a trigger on my side. You just replace the trigger on your side and configure the appropriate Dynamic content in Get user profile action.

Image reference:

14.PNG

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: Error Handling for capturing Office 365 user Profile and adding a record into Excel

Hi @Anonymous ,

 

Do you want to collect information about employees who do not have an O365 email/id?

 

You could try to configure Add a row into a table action with Configure run after. "Add a row into a table" action is executed only when "Get user profile (v2)” action fails.

 

I use Button as a trigger on my side. You just replace the trigger on your side and configure the appropriate Dynamic content in Get user profile action.

Image reference:

14.PNG

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (3,775)