cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mandree
Frequent Visitor

Creating sharepoint element, if Office 365 User has a manager

Hello,

 

I want to create a sharepoint list element, if a user has a manager in Office 365. The problem I have, the element "Get manager" throws an error, if he has not a manager.

 

The good thing is, that my flow are creating the elements for the users, who has a manager.

The bad thing is, that the flow said he had an mistake, but I only want to ignore these errors.

 

In other programming languages, I would use "HasManager" and would then use "GetManager". But I dont know, how to do this in Power Automate.

 

Mandree_0-1635431569760.png

Thanks for your help.

 

Best regards

Marcel

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Mandree :

You could add a "Terminate" after the 'apply to each' action

vbofengmsft_3-1635732157224.png

vbofengmsft_1-1635732118459.pngvbofengmsft_2-1635732130459.png

Best Regards,

Bof

 

View solution in original post

6 REPLIES 6
eliotcole
Power Participant
Power Participant

Have a play with the Groups Graph actions, I'm currently trying to find out how to display manager details via a Graph HTTP call, but it's not easy!

v-bofeng-msft
Community Support
Community Support

Hi @Mandree :

If the target user does not use a manager, then Get manger will fail. So you only need to add a branch under Get manger, execute branch A successfully, and execute branch B if execution fails, so that even if flow reports an error when running, it can ensure that the function is normal.

1\Add a parallel branch

vbofengmsft_0-1635493916974.png

2\

vbofengmsft_1-1635494032238.png

vbofengmsft_3-1635494069756.png

The Result:

You can find that the fourth loop execution failed, Flow did not end immediately, and the fifth loop executed successfully.

vbofengmsft_5-1635494305383.png

 

vbofengmsft_6-1635494344739.png

Best Regards,

Bof

 

 

Thanks for your reply. But I wrote, that my flow does the same.

"The good thing is, that my flow are creating the elements for the users, who has a manager."

 

But what I dont want, that in the flowhistory the status jumps on error.

Mandree_0-1635502402024.png

 

So how could I edit my flow, that I dont get an error in flow history.

 

eliotcole
Power Participant
Power Participant

The Groups connector has a Graph HTTP request action that you should be able to interact with graph to check manager status a little better ... I've just been struggling to find the right way in for you on that.

 

Seriously, I hyper-focused on this for HOURS yesterday by mistake ... but it was educational for me!

 

The manager information is an additional set of information on a user that isn't always sent with the core data about a user, and I have just been struggling to get it to show for the (admittedly 'guest') users that have me as a manager for testing purposes in my personal tenancy.

 

eliotcole
Power Participant
Power Participant

Also, sorry for second post, @Mandree , but it's a different point. Have you tried using different connectors, like Groups, anyway?

Hi @Mandree :

You could add a "Terminate" after the 'apply to each' action

vbofengmsft_3-1635732157224.png

vbofengmsft_1-1635732118459.pngvbofengmsft_2-1635732130459.png

Best Regards,

Bof

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,290)