Power Automate Create SharePoint News Post Error

Copper Contributor

I am attempting to make a flow that generates a SharePoint News Post from an email. I have been using the video here as a guide. The flow triggers when an email comes to a specific folder > creates a copy of a News Post > checks out the copied News Post > saves the copied News Post as a draft with updated content > and finally publishes it. However I keep getting an error when it attempts to save the post as a draft. Error: The method .ctor does not have parameters. I am afraid I am a bit out of my depth here, any suggestions or reference to documentation would be greatly appreciated.

 

Flow Details: 

mykeoc_0-1684236715421.pngmykeoc_1-1684236765867.png

mykeoc_2-1684236806589.pngmykeoc_3-1684236841969.pngmykeoc_4-1684236880301.png

Body of  Send a new News Post using News Schema

{
   "__metadata":{
      "type":"SP.Publishing.SitePage"
   },
   "LayoutWebpartsContent":"[{\"id\":\"cbe7b0a9-3504-44dd-a3a3-0e5cacd07788\",\"instanceId\":\"cbe7b0a9-3504-44dd-a3a3-0e5cacd07788\",\"title\":\"\\n      Title area\\n    \",\"description\":\"\\n      Title area description\\n    \",\"audiences\":[],\"serverProcessedContent\":{\"htmlStrings\":{},\"searchablePlainTexts\":{},\"imageSources\":{\"imageSource\":\"https://cdn.hubblecontent.osi.office.net/m365content/publish/27dbea74-71b3-44c2-b1dc-ff597bdcd75e/686732223.jpg\"},\"links\":{},\"customMetadata\":{\"imageSource\":{\"width\":4096,\"height\":2730}}},\"dataVersion\":\"1.4\",\"properties\":{\"imageSourceType\":2,\"title\":\"Email News Template\",\"textAlignment\":\"Left\",\"showPublishDate\":false,\"authors\":[{\"id\":\"i:0#.f|membership|********\",\"upn\":\"********\",\"email\":\"********\",\"name\":\"********\",\"role\":\"SharePoint Administrator\"}],\"showTopicHeader\":true,\"authorByline\":[\"i:0#.f|membership|********\"],\"layoutType\":\"CutInShape\",\"titlePlaceholder\":\"Name your news post\",\"topicHeader\":\"Email News\",\"enableGradientEffect\":true,\"hasTitleBeenCommitted\":true,\"translateX\":52.57731958762887,\"translateY\":52.19298245614035,\"imgHeight\":2730,\"imgWidth\":4096},\"containsDynamicDataSource\":false,\"reservedHeight\":306}]",
   "CanvasContent1":"[{\"controlType\":4,\"id\":\"1212fc8d-dd6b-408a-8d5d-9f1cc787efbb\",\"position\":{\"controlIndex\":2,\"sectionIndex\":1,\"sectionFactor\":12,\"zoneIndex\":1,\"layoutIndex\":1},\"addedFromPersistedData\":true,\"innerHTML\":\"<p>dynamic news content</p>\"},{\"controlType\":0,\"pageSettingsSlice\":{\"isDefaultDescription\":true,\"isDefaultThumbnail\":true,\"isSpellCheckEnabled\":true,\"globalRichTextStylingVersion\":1,\"rtePageSettings\":{\"contentVersion\":4},\"isEmailReady\":false}}]",
   "AuthorByline":[
      "i:0#.f|membership|********"
   ],
   "TopicHeader":"Email News",
   "BannerImageUrl":"https://cdn.hubblecontent.osi.office.net/m365content/publish/27dbea74-71b3-44c2-b1dc-ff597bdcd75e/686732223.jpg",
   "Title":"Email News Template"
}

mykeoc_5-1684237140459.png

 

Error Details: 

mykeoc_6-1684237255436.png

 

Error Body of Send a new News Post using News schema

{
  "status": 400,
  "message": "The method .ctor does not have parameters.\r\nclientRequestId: 563385b5-be58-44a0-b0c3-848f48cbed5e\r\nserviceRequestId: d031b3a0-c00c-3000-8e68-7ac9326ea870",
  "source": "https://********/sites/MykeTest/_api/sitepages(18)/savepageasdraft",
  "errors": [
    "-1",
    "Microsoft.SharePoint.Client.InvalidClientQueryException"
  ]
}

 

0 Replies