0

When a modern SharePoint news is being published we send a notification to a certain audience via Power Automate Flow. Easy via a trigger on the Site Pages library:

enter image description here

We detect via the PromotedState=2 property that the news has been published (vs. just being edited) and send the notification.

Now the notification message shall look different when the page is being edited and re-published. This seems to be trickier than I initially thought.

I thought about using the FirstPublishedDate and Modified properties somehow but apparently the Modified date can change without the need to re-publish the page.

So the question is: given a SharePoint modern news page, how can I detect that this page has been published more than once - without going back into the item history or tracking changes of the PromotedState property myself? Some kind of LastPublishedDate would really be handy.

1 Answer 1

0

It hit me that the major version of the news post could serve as publish count. Every time you publish the news a new major version is created as well. Drafts are stored as minor versions.

BUT there is one quirk with modern news: when you publish a news post from the page's three-dot-menu instead of the edit view the PromotedState is not set to 2!

enter image description here

So you end up with a "published" page (in the classic SharePoint sense, with a major version) but not with a "published" news post (in the "modern news" sense). I could cuss for days on end.

So I ended up going back into the version history, counting all major versions that have PromotedState set to 2. This gives me the publish count while ignoring any initial games the author played with the "native" publish function of SharePoint.

Bonus quirk: you can "promote" a "SharePoint-published" page to a real published news post:

enter image description here

But this does not update PromotedState immediately. You rather have to put the page into edit mode and publish it again. Only then is the PromotedState set to 2.

2
  • You can accept this answer and upvote it to help other users with the same problem find effective content more directly. :) Commented Aug 6, 2021 at 6:47
  • @ElsieLu_MSFT Yep I will do as soon as StackExchange lets me do this :) One has to wait 2 or 3 days for other answers to come in I guess. Commented Aug 6, 2021 at 6:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.