cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
landonjochim
Resolver II
Resolver II

Solution: How to use the MS Teams: 'Post a Feed Notification' Action & How to get members of a Private Teams Channel

The Power Automate - Microsoft Teams: Post a Feed Notification seems like a relatively straight forward action that can provide a high level of value. Though it can provide a high level of value, it is not all that straight forward…

 

The Action requires the following properties:

      • Post As
      • Notification Type
      • Recipient
      • Team
      • Channel

 

The part which is most confusing is the Recipient field. Almost every time I have tried to use this action I receive the error message of "The response is not in a JSON format." umm ok?

 

landonjochim_0-1650550041034.png

 

The Recipient property says to specify a User ID, but even when using the Get User Profile 365 Action to retrieve the User ID, it still errors with that same error message. Same is the case when providing an Email of the recipient.

 

So how to solve this?

 

      1. Within the Team which you are wanting to Post the Feed Notification, go to Details
      2. Then click See all Members

landonjochim_1-1650550041037.png

 

      1. Click on the Apps tab
      2. Then click the More apps button

landonjochim_2-1650550041040.png

 

      1. Click the Power Automate app

landonjochim_3-1650550041041.png

 

      1. Click on the dropdown arrow to the right of Add, click Add to a Team

landonjochim_4-1650550041042.png

 

      1. Then click on the dropdown arrow to the right of Set up, click Set up a bot

landonjochim_5-1650550041042.png

 

 

That’s it! Test your flow and everything should run without a hitch. Such an unspecific error message, and there seems to be no documentation anywhere that Microsoft has published showing that adding the Power Automate bot as a prerequisite for this Action to work.. Hope this helped

 

landonjochim_6-1650550041043.png

 

 

landonjochim_7-1650550041043.png

Top Line: Name of the Workflow (Workflow Owner DisplayName)

Middle Line: Notification Text property for the Action

Bottom Line: Team > Channel

 

Bonus: How to send a notification to an entire Team?

 

Use an action like the "List Group Members" one that will list everyone within the Office 365 Group that is created for the Team.

 

Then cycle through each value in an Apply to Each to send each group member the feed notification

landonjochim_8-1650550041044.png

 

 

Double Bonus: How to send a notification to all members of a private channel?

 

Private channels actually create their own SharePoint Team Site in the backend separate from the Team Site that is created for the Team. However, it does not create another Office 365 Group.

 

So we need to get all the users from the Members SharePoint Group of that private channels Team Site.

 

      1. Within the Private Channel in MS Teams, click on the three dot ellipsis
      2. Then click Open in SharePoint

landonjochim_9-1650550041045.png

 

      1. Navigate to the Home page of the Team Site
      2. Add this to the end of the Home page URL: /_layouts/15/user.aspx

Example:

landonjochim_10-1650550041046.png

 

 

      1. Click on the default Members SharePoint Group

landonjochim_11-1650550041046.png

 

      1. In the URL, find the MembershipGroupID

landonjochim_12-1650550041047.png

 

      1. Now back in your Workflow, add the Send HTTP request to SharePoint action
        • Site Address: <URL to Private Channel SharePoint Team Site>
        • Method: GET
        • Uri: _api/web/sitegroups/GetById(<MembershipGroupID>)/users

 

landonjochim_13-1650550041047.png

 

      1. Add a Parse JSON action
        • Content: body('Send_an_HTTP_request_to_SharePoint')
        • Schema: Copy the outputs from a previous run of the Send an HTTP request into the "Generate from Sample"
      2. Add an Apply to Each action
        • Output from previous steps: body('Parse_JSON')?['d']?['results']
      3. Then add your Post a feed notification action with the recipient being: items('Apply_to_each:_Private_Channel_Group_Members')?['UserPrincipalName']

 

All done!

1 REPLY 1
OzOscroft
Frequent Visitor

Thanks @LanD, really useful.  Unfortunately I'm experiencing this issue with users who are using the "Follow up later" flow from chats / group chats.  Would the solution here be for them to add the Power Apps app to Teams?

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (5,054)