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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / json - format a sharep...
Power Automate
Unanswered

json - format a sharepoint news post

(0) ShareShare
ReportReport
Posted on by

I'm hoping someone is able to assist me.  I have created a communications form using a SharePoint list.  Once the form is submitted I have it creating a SharePoint news post.  My problem is that formatting of the news post.  Can someone please assist me with formatting the news post similar to the attached document?

 

thressac_0-1619190295329.png

{

"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\":\"\"},\"links\":{},\"customMetadata\":{\"imageSource\":{}}},\"dataVersion\":\"1.4\",\"properties\":{\"imageSourceType\":2,\"title\":\"Test\",\"textAlignment\":\"Left\",\"showPublishDate\":false,\"authors\":[{\"id\":\"\",\"upn\":\"\",\"email\":\"\",\"name\":\"\",\"role\":\"\"}],\"showTopicHeader\":false,\"authorByline\":[\"\"],\"layoutType\":\"CutInShape\",\"titlePlaceholder\":\"Name your news post\",\"topicHeader\":\"\"},\"reservedHeight\":356}]","CanvasContent1":"[{\"controlType\":4,\"id\":\"1212fc8d-dd6b-408a-8d5d-9f1cc787efbb\",\"position\":{\"controlIndex\":2,\"sectionIndex\":1,\"sectionFactor\":12,\"zoneIndex\":1,\"layoutIndex\":1},\"addedFromPersistedData\":true,\"innerHTML\":\"@{triggerOutputs()?['body/Topic_x002f_Issue']}\",\"emphasis\":{}},{\"controlType\":0,\"pageSettingsSlice\":{\"isDefaultDescription\":true,\"isDefaultThumbnail\":true}}]","Title":""}@{triggerOutputs()?['body/Title']}

 

https://powerusers.microsoft.com/t5/Building-Flows/Create-a-news-post-when-a-list-item-is-created/m-p/841111

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @Anonymous,

     

    You could add some html markup to your CanvasContent1 section of the json you currently have.

     

    Below is an example of that:

     

    "CanvasContent1":"[{\"controlType\":4,\"id\":\"1212fc8d-dd6b-408a-8d5d-9f1cc787efbb\",\"position\":{\"controlIndex\":2,\"sectionIndex\":1,\"sectionFactor\":12,\"zoneIndex\":1,\"layoutIndex\":1},\"addedFromPersistedData\":true,\"innerHTML\":\"<h2><span class=\\\"fontColorYellow\\\">Service Center Today's Update</span><br></h2><p><span class=\\\"fontColorBlueLight\\\">Topic / Issue</span></p><p><br></p><p><strong>Line of Business: QPP</strong></p><p><strong>KB Article Reference: KB00012345</strong></p><p><br></p><p>Did you know:</p><p><em>Insert Communication / Message</em><br></p><p>Insert Signature<br></p><p><br></p>\",\"emphasis\":{}},{\"controlType\":0,\"pageSettingsSlice\":{\"isDefaultDescription\":true,\"isDefaultThumbnail\":true}}]",

     

     

    canvascontent1_example.png

  • Community Power Platform Member Profile Picture
    on at

    @Expiscornovus , thank you for the suggestion.  I add the html markup but keep getting a 502 error bad gateway.

    I'm sure I'm definitely doing something wrong.

     

     

    {
    "error": {
    "code": 502,
    "source": "flow-apim-msmanaged-na-centralus-01.azure-apim.net",
    "clientRequestId": "e8ae18bd-0e41-4bb8-91a3-1353d919774f",
    "message": "BadGateway",
    "innerError": {
    "status": 502,
    "message": "<?xml version=\"1.0\" encoding=\"utf-8\"?><m:error xmlns:m=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\"><m:code>-1, System.Runtime.Serialization.SerializationException</m:code><m:message xml:lang=\"en-US\">Expecting state 'Element'.. Encountered 'Text' with name '', namespace ''. </m:message></m:error>\r\nclientRequestId: e8ae18bd-0e41-4bb8-91a3-1353d919774f\r\nserviceRequestId: 3258c49f-f02e-c000-0163-093d8c6c3238",
    "source": "https://ventechsolutionsllc.sharepoint.com/sites/U-HUB/The-Hub/_api/sitepages/pages(31)/SavePageAsDraft",
    "errors": []
    }
    }
    }

     

    {
    "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\":\"\"},\"links\":{},\"customMetadata\":{\"imageSource\":{}}},\"dataVersion\":\"1.4\",\"properties\":{\"imageSourceType\":2,\"title\":\"Test\",\"textAlignment\":\"Left\",\"showPublishDate\":false,\"authors\":[{\"id\":\"\",\"upn\":\"\",\"email\":\"\",\"name\":\"\",\"role\":\"\"}],\"showTopicHeader\":false,\"authorByline\":[\"\"],\"layoutType\":\"CutInShape\",\"titlePlaceholder\":\"Name your news post\",\"topicHeader\":\"\"},\"reservedHeight\":356}]",""CanvasContent1":"[{\"controlType\":4,\"id\":\"1212fc8d-dd6b-408a-8d5d-9f1cc787efbb\",\"position\":{\"controlIndex\":2,\"sectionIndex\":1,\"sectionFactor\":12,\"zoneIndex\":1,\"layoutIndex\":1},\"addedFromPersistedData\":true,\"innerHTML\":\"<h2><span class=\\\"fontColorYellow\\\">Service Center Today's Update</span><br></h2><p><span class=\\\"fontColorBlueLight\\\">Topic / Issue</span></p><p><br></p><p><strong>Line of Business: QPP</strong></p><p><strong>KB Article Reference: KB00012345</strong></p><p><br></p><p>Did you know:</p><p><em>Insert Communication / Message</em><br></p><p>Insert Signature<br></p><p><br></p>\",\"emphasis\":{}},{\"controlType\":0,\"pageSettingsSlice\":{\"isDefaultDescription\":true,\"isDefaultThumbnail\":true}}]","CanvasContent1":"[{\"controlType\":4,\"id\":\"1212fc8d-dd6b-408a-8d5d-9f1cc787efbb\",\"position\":{\"controlIndex\":2,\"sectionIndex\":1,\"sectionFactor\":12,\"zoneIndex\":1,\"layoutIndex\":1},\"addedFromPersistedData\":true,\"innerHTML\":\"@{triggerOutputs()?['body/Description']}\",\"emphasis\":{}},{\"controlType\":0,\"pageSettingsSlice\":{\"isDefaultDescription\":true,\"isDefaultThumbnail\":true}}]","Title":"@{triggerOutputs()?['body/Title']}"}

     

  • jleystral Profile Picture
    97 on at

    Would it be possible to insert a hyperlink as well?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard