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

Community site session details

Session Id : lInEZ1dz+vlGLAzKIroPrJ
Power Automate - General Discussion
Answered

Disable SharePoint News Post Commenting after 2 weeks

Like (0) ShareShare
ReportReport
Posted on 2 Mar 2023 19:05:48 by 16

Hello.  When a News Post Site Page is created on our site, comments will initially be allowed.  After 2 weeks from the creation date of the news post, it is requested to disable commenting on that news post.  I'd be interested on hearing ways to do this.  I'm fairly new to PA and can't even get past creating the initial trigger.  Thanks.

I have the same question (0)
  • Verified answer
    annajhaveri Profile Picture
    8,531 Most Valuable Professional on 03 Mar 2023 at 07:39:12
    Re: Disable SharePoint News Post Commenting after 2 weeks

    @bdufort  you can create a scheduled flow that runs everyday. Then use Get Items action to get items from Site Pages, provide below filter query in Get Items to get the news pages which were created 2 weeks back. 

    Created eq '@{formatDateTime(addDays(utcNow(),-14),'yyyy-MM-dd')}' and PromotedState eq 2

     

    annajhaveri_0-1677829043493.png

    Site Pages will not appear in List Name dropdown, so select custom value from dropdown and type in Site Pages.

     

    Then you can loop through the output of Get Items action, and using REST API you can disable comments on the pages returned by Get Items. Here is a post that shows how to use REST API to disable comments on a page https://powerusers.microsoft.com/t5/Building-Flows/Flow-to-disable-commenting-in-modern-page/td-p/1317846

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 786 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 724 Super User 2025 Season 2

#3
stampcoin Profile Picture

stampcoin 290 Super User 2025 Season 2

Last 30 days Overall leaderboard