cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tt10
New Member

Flow is failing when posting to private channel as Flow Bot

Hi have a Power App which has a form that triggers a flow upon submission. This flow is designed to post a message into a private Teams channel and looks like this:

tt10_0-1664279009188.png

 

In testing this has worked fine and I see the card posted into the channel. But when I ask a user who is not a member of this private channel to test the app, this part of the flow fails with the following message:

 

The sender with objectId '622324eb-78d5-4241-a436-e06fd55aee76' is not a member or an owner of the team.

 

I presume this is because the user of app is not a member of the private channel, but I thought that was the whole point of the "Post as: Flow Bot" option. To be clear, this works fine when I use the app myself, and it seems the only difference is that I am a member of the private channel and my test user isn't.

 

How can I solve this and decouple the user context of the flow from the Teams post step?

1 ACCEPTED SOLUTION

Accepted Solutions
iAm_ManCat
Super User
Super User

This is because you are triggering it from within the context of the App (can see you passed mhfaEmail in) and so the flow will run in the context of the signed-in user. For example, the other user wouldn't be able to set up a standalone flow that posts to that channel as they do not have access to it, so you cannot give them access that they do not have.

 

You need to abstract this data from the user context by putting it somewhere else first and having that trigger a flow, then the flow will run in the context of the connections that it is set up with.

 

So for example if you posted the mhfaEmail value to a Dataverse table or sharepoint list, and then had a triggered flow that runs when a new item is created, then it will run as a standalone flow with the connections you set it up with.

 

Hope this helps!

Cheers,

Sancho

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

1 REPLY 1
iAm_ManCat
Super User
Super User

This is because you are triggering it from within the context of the App (can see you passed mhfaEmail in) and so the flow will run in the context of the signed-in user. For example, the other user wouldn't be able to set up a standalone flow that posts to that channel as they do not have access to it, so you cannot give them access that they do not have.

 

You need to abstract this data from the user context by putting it somewhere else first and having that trigger a flow, then the flow will run in the context of the connections that it is set up with.

 

So for example if you posted the mhfaEmail value to a Dataverse table or sharepoint list, and then had a triggered flow that runs when a new item is created, then it will run as a standalone flow with the connections you set it up with.

 

Hope this helps!

Cheers,

Sancho

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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