
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.
@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
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