SOLVED

News Post comment Notifications to CreatedBy, not to Custom Author set in news page

Copper Contributor

For a customer I'm trying to find out if it's possible to have notifications about comments and likes received on a newspost send to the custom author set in the news post and not the account creating the article. 

We have many users that created an article in Word, then have it reviewed by our comms department who will then publish the article with the original author set in the article. Notifications on comments an likes are then received by the person who created the news page and are not send to the custom author in the article. 

Is this as designed and if so, is there a possibility to change where the notifications are send to?

 

Thanx all in advance.

2 Replies
best response confirmed by FritsH78 (Copper Contributor)
Solution

@FritsH78 out of the box you can't change who gets the notifications and it's annoying the way Microsoft have implemented this. But there is a solution to this! At my company we have a similar system where I am usually publishing the articles but I am not the writer of them or the contact for comments etc. So what I do as soon as I publish a news story is to change the created by column using a JSON-formatted button in the list which triggers a flow in Power Automate to change the created by column to the contact for the story.

 

1. Create an instant flow from blank. The trigger is the SharePoint "for a selected file trigger". Select the site and type in Site Pages as a custom value in the library field. We need a way to tell the flow which user to change the create by column to, so we add a number input which will later use the unique ID, called a P number, that all our staff are given.

1a-Trigger.png

 

Next, add a Send an HTTP request to "SharePoint" action and select the site. 

  • The method is POST.
  • The Uri is as follows; delete the //ID// text I've put in and select ID from the dynamic content box.

    _api/web/lists/getByTitle('Site Pages')/items(//ID//)/validateUpdateListItem
  • Leave the headers field empty
  • In the Body field paste in the following JSON, delete the //Number// text I've typed in and select from the dynamic content box the column you are using to identify the person to change the created by to

    {
    "formValues":[
    {
    "FieldName": "Author",
    "FieldValue": "[{'Key':'i:0#.f|membership|p//Number//@capita.co.uk'}]"
    },
    {
    "FieldName": "Editor",
    "FieldValue": "[{'Key':'i:0#.f|membership|p//Number//]}@capita.co.uk'}]"
    }
    ],
    "bNewDocumentUpdate": true
    }
    1b-SendHttpRequest.png

 

Name & save your flow and copy the ID.

 

2a-FlowID.png

 

 

2. In the SharePoint list add a single of text column and format it with the following JSON, changing the flow id in the actionParams line to your flow's ID:

 

 

 

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "button",
  "txtContent": "Change Created By to name of page contact",
  "customRowAction": {
    "action": "executeFlow",
    "actionParams": "='{\"id\":\"50097cde-b800-4c6c-ade9-95be7574f4e5\", \"headerText\":\" ' + [$Title] + '\",\"runFlowButtonText\":\"Go\"}'"
  },
  "style": {
    "background-color": "#cf000f",
    "color": "white",
    "border-radius": "10px"
  }
}

 

 

 

 

That will add a button that looks like this:


0-SP.png

 

When you click the button a pane will open where you enter the user to change the created by column to:

3-flowPane-headerText.png

 

When you click the Go button the flow will run and after a few seconds the created by column will be changed. The news stories with the arrows below were created by me but by running this flow have had their created by column changed to the contact for the story

 

4-AuthorChanged.png

 

Come back with any questions about this.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

 

@RobElliott thanx, as there’s not an out of the box solution available, this is the next best thing. Our comms department is very pleased with this.

1 best response

Accepted Solutions
best response confirmed by FritsH78 (Copper Contributor)
Solution

@FritsH78 out of the box you can't change who gets the notifications and it's annoying the way Microsoft have implemented this. But there is a solution to this! At my company we have a similar system where I am usually publishing the articles but I am not the writer of them or the contact for comments etc. So what I do as soon as I publish a news story is to change the created by column using a JSON-formatted button in the list which triggers a flow in Power Automate to change the created by column to the contact for the story.

 

1. Create an instant flow from blank. The trigger is the SharePoint "for a selected file trigger". Select the site and type in Site Pages as a custom value in the library field. We need a way to tell the flow which user to change the create by column to, so we add a number input which will later use the unique ID, called a P number, that all our staff are given.

1a-Trigger.png

 

Next, add a Send an HTTP request to "SharePoint" action and select the site. 

  • The method is POST.
  • The Uri is as follows; delete the //ID// text I've put in and select ID from the dynamic content box.

    _api/web/lists/getByTitle('Site Pages')/items(//ID//)/validateUpdateListItem
  • Leave the headers field empty
  • In the Body field paste in the following JSON, delete the //Number// text I've typed in and select from the dynamic content box the column you are using to identify the person to change the created by to

    {
    "formValues":[
    {
    "FieldName": "Author",
    "FieldValue": "[{'Key':'i:0#.f|membership|p//Number//@capita.co.uk'}]"
    },
    {
    "FieldName": "Editor",
    "FieldValue": "[{'Key':'i:0#.f|membership|p//Number//]}@capita.co.uk'}]"
    }
    ],
    "bNewDocumentUpdate": true
    }
    1b-SendHttpRequest.png

 

Name & save your flow and copy the ID.

 

2a-FlowID.png

 

 

2. In the SharePoint list add a single of text column and format it with the following JSON, changing the flow id in the actionParams line to your flow's ID:

 

 

 

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "button",
  "txtContent": "Change Created By to name of page contact",
  "customRowAction": {
    "action": "executeFlow",
    "actionParams": "='{\"id\":\"50097cde-b800-4c6c-ade9-95be7574f4e5\", \"headerText\":\" ' + [$Title] + '\",\"runFlowButtonText\":\"Go\"}'"
  },
  "style": {
    "background-color": "#cf000f",
    "color": "white",
    "border-radius": "10px"
  }
}

 

 

 

 

That will add a button that looks like this:


0-SP.png

 

When you click the button a pane will open where you enter the user to change the created by column to:

3-flowPane-headerText.png

 

When you click the Go button the flow will run and after a few seconds the created by column will be changed. The news stories with the arrows below were created by me but by running this flow have had their created by column changed to the contact for the story

 

4-AuthorChanged.png

 

Come back with any questions about this.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

 

View solution in original post