web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Publish news from Comm...
Power Automate
Suggested Answer

Publish news from Communication site to Teams channel

(0) ShareShare
ReportReport
Posted on by
Hi!
 
I am trying to publish news from a SharePoint communication site to a Teams channel using a flow in Power Automate. However, Power Automate is unable to access the Site Pages library in SharePoint. Is there a workaround for this?
 
Thanks.
Br,
Geraldine
Categories:
I have the same question (0)
  • Suggested answer
    Ninjasabi Profile Picture
    122 on at

    To publish news from a SharePoint Communication site to a Teams channel using Power Automate, the inability to access the Site Pages library may stem from insufficient permissions or incorrect configuration in your flow. Below is a step-by-step guide and a workaround to achieve your goal:


    Step-by-Step Solution

    1. Check Permissions on the Site Pages Library

    • Ensure the account used in Power Automate has at least Contribute or Edit permissions on the Site Pages library:
      1. Navigate to the SharePoint Communication site.
      2. Go to Site Contents > Site Pages.
      3. Check permissions for the Power Automate user account (or group).
      4. Grant permissions if necessary.

    2. Create a Flow to Monitor Site Pages

    • Use the "When an item is created or modified" trigger:
      1. Select the SharePoint Site Pages library.
      2. If Power Automate cannot access this library directly, use an HTTP request as a workaround.

    3. Workaround: Use "Send an HTTP Request to SharePoint"

    If the Site Pages library is not accessible through the standard actions:

    • Add the "Send an HTTP Request to SharePoint" action:
      1. Site Address: Select the communication site.
      2. Method: GET
      3. URI:
        _api/web/lists/getbytitle('Site Pages')/items?$filter=PromotedState eq 2&$orderby=Modified desc
        • This retrieves news posts (PromotedState eq 2) sorted by the last modified date.

    4. Extract Key Information from the News Post

    • Use a Parse JSON action to process the response from the HTTP request.
    • Input the body of the HTTP request, and generate the schema automatically by running the flow once.

    5. Post to Teams Channel

    • Use the "Post a message in a chat or channel" action:
      1. Team: Select the target team.
      2. Channel: Select the desired channel.
      3. Message: Format the news post dynamically:
        • Example message:
          <strong>New SharePoint News Published:</strong><br>
          <a href="@{item()?['FileRef']}">@{item()?['Title']}</a><br>
          Published on: @{item()?['Modified']}

    Flow Example Outline

    1. Trigger:
      • Use "When an item is created or modified" or manually query using an HTTP request.
    2. Send HTTP Request (if needed):
      • Retrieve news posts dynamically from the Site Pages library.
    3. Parse JSON:
      • Parse the response from the HTTP request.
    4. Post to Teams:
      • Use the "Post a message in a chat or channel" action to share the news.

    Key Troubleshooting Points

    1. Library Accessibility:
      • Verify that the Power Automate user has access to the Site Pages library.
      • Use the HTTP request workaround if the default actions fail.
    2. News Page Filter:
      • Ensure you’re only retrieving news posts by filtering on PromotedState eq 2.
    3. Teams Message Format:
      • Test different formats for the message to ensure it’s user-friendly and clickable.

    Let me know if you need further assistance with setting this up or debugging specific steps! 😊

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 484

#2
Valantis Profile Picture

Valantis 477

#3
Haque Profile Picture

Haque 456

Last 30 days Overall leaderboard