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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Create a news when an ...
Power Automate
Answered

Create a news when an item is created - Help With Previous post

(0) ShareShare
ReportReport
Posted on by 185

https://powerusers.microsoft.com/t5/General-Power-Automate/Create-a-news-when-an-item-is-created-Question/m-p/1794233#M104269

 

I tried to add this on my previous post but did not get a respond. I am having issue with the following payload: Currently its getting an old image instead of going to the new highlighted path. Does anyone know how can I remove the other part of the code without breaking it? I want to keep the image width and height

 

knishal_0-1664799572970.png

 

 

 

":{\"htmlStrings\":{},\"searchablePlainTexts\":{},\"imageSources\":{\"imageSource\":\"https://*****.sharepoint.com/sites/******@{outputs('Create_file')?['body/Path']}\"},\"links\":{},\"customMetadata\":{\"imageSource\":{\"siteId\":\"8b1269f1-0b51-4d65-8648-988e4de0d7e5\",\"webId\":\"903f209d-3dcd-43e0-b799-ec4e6d919741\",\"listId\":\"e64df230-dcf9-4709-99d6-60b929de500b\",\"uniqueId\":\"{4864A77F-A1AE-40F3-8CE5-6C9C6D97124B}\",\"width\":250,\"height\":250}}},\"dataVersion\":\"1.9\",\"properties\":{\"id\":\"cb8accc6-7ac8-4a14-9c48-10a1a1b03ada\",\"linkUrl\":\"\",\"isInlineImage\":true,\"siteId\":\"8b1269f1-0b51-4d65-8648-988e4de0d7e5\",\"webId\":\"903f209d-3dcd-43e0-b799-ec4e6d919741\",\"listId\":\"e64df230-dcf9-4709-99d6-60b929de500b\",\"uniqueId\":\"{4864A77F-A1AE-40F3-8CE5-6C9C6D97124B}\",\"imgHeight\":250,\"imgWidth\":250,\"imageSourceType\":2,\"alignment\":\"Left\",\"fixAspectRatio\":false,\"overlayText\":\"\",\"altText\":\"\"}},\"controlType\":3,\"id\":\"40e50eeb-46f0-4a8f-b0d2-b22239071d9e\",\"webPartId\":\"

 

 

 

 

Categories:
  • Expiscornovus Profile Picture
    34,005 Most Valuable Professional on at

    Hi @knishal,

     

    You want to set the Banner Image Url, correct?

     

    The BannerImageUrl is a property which is not nested within either the LayoutWebpartsContent or the CanvasContent1 section. It is a property on the first level of the json.

     

    The imageSource property is used for images embedded within the page in certain web parts/controls, that is something different.

     

    To oversimplify things, below would be the structure

     

     

    {"__metadata":{"type":"SP.Publishing.SitePage"},
    "LayoutWebpartsContent":"[]",
    "CanvasContent1":"[]",
    "BannerImageUrl":"https://cdn.hubblecontent.osi.office.net/m365content/publish/2a861c03-fef0-41d0-b67c-904fc0bd2abf/908752706.jpg",
    "Title":"PageTitle"
    }

     

     

  • knishal Profile Picture
    185 on at

    Hi @Expiscornovus  this is a separate image that I want to embedd into the page. The banner URL is working now. I want to display an image on that created page with someone text next to it. I saved the payload when publishing the page and the image source is the issue. When I add the path to the image its showing the previous image

     

  • knishal Profile Picture
    185 on at

    @Expiscornovus I am trying to achieve the following format: I have the image path url and the title/name  from the dynamic content. Do you have any payload that could fix this? The image width should be 250 x 250

     

    knishal_0-1664911635733.png

     

    I am currently using the payload from a template page.

     

    Is it possible to modify yours to achieve that result?

    {
    "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/Description']}\",\"emphasis\":{}},{\"controlType\":0,\"pageSettingsSlice\":{\"isDefaultDescription\":true,\"isDefaultThumbnail\":true}}]","Title":"@{triggerOutputs()?['body/Title']}"}

     

     

  • Verified answer
    Expiscornovus Profile Picture
    34,005 Most Valuable Professional on at

    Hi @knishal,

     

    Yes, that embedding should also be possible. Both that is definitely a more complicated scenario. 

     

    You would need to tell where the image is coming from. The json would require some additional GUIDs which will refer to the siteid, listid and uniqueid of the image file you want to embed.

     

    Also you would need the html for within the text web part to align the text next to the image.

     

    Below is a sample of such type of json. Can you test that?

     

    {"__metadata":{"type":"SP.Publishing.SitePage"},"CanvasContent1":"[{\"position\":{\"controlIndex\":0,\"sectionIndex\":1,\"sectionFactor\":12,\"zoneIndex\":1,\"layoutIndex\":1},\"webPartData\":{\"id\":\"d1d91016-032f-456d-98a4-721247c305e8\",\"instanceId\":\"3867d793-7562-4f3d-8913-7fb431a26f59\",\"title\":\"Image\",\"description\":\"Add an image, picture or photo to your page including text overlays and ability to crop and resize images.\",\"audiences\":[],\"serverProcessedContent\":{\"htmlStrings\":{},\"searchablePlainTexts\":{},\"imageSources\":{\"imageSource\":\"@{variables('GetFileByRelativeServerUrl')}\"},\"links\":{},\"customMetadata\":{\"imageSource\":{\"siteId\":\"@{variables('SiteId')}\",\"webId\":\"@{variables('WebId')}\",\"listId\":\"@{variables('ListId')}\",\"uniqueId\":\"@{variables('uniqueId')}\",\"width\":250,\"height\":250}}},\"dataVersion\":\"1.9\",\"properties\":{\"id\":\"fc44c6a4-1932-4017-b477-75be978a610a\",\"linkUrl\":\"\",\"isInlineImage\":true,\"siteId\":\"@{variables('SiteId')}\",\"webId\":\"@{variables('WebId')}\",\"listId\":\"@{variables('ListId')}\",\"uniqueId\":\"@{variables('uniqueId')}\",\"imgHeight\":250,\"imgWidth\":250,\"imageSourceType\":2,\"alignment\":\"Left\",\"fileName\":\"image250x250.png\",\"fixAspectRatio\":false,\"overlayText\":\"\",\"altText\":\"\"}},\"controlType\":3,\"id\":\"3867d793-7562-4f3d-8913-7fb431a26f59\",\"webPartId\":\"d1d91016-032f-456d-98a4-721247c305e8\",\"rteInstanceId\":\"1212fc8d-dd6b-408a-8d5d-9f1cc787efbb\",\"addedFromPersistedData\":true,\"reservedHeight\":276,\"reservedWidth\":250},{\"controlType\":4,\"id\":\"1212fc8d-dd6b-408a-8d5d-9f1cc787efbb\",\"position\":{\"controlIndex\":2,\"sectionIndex\":1,\"sectionFactor\":12,\"zoneIndex\":1,\"layoutIndex\":1},\"addedFromPersistedData\":true,\"innerHTML\":\"<p><br></p><div tabindex=\\\"-1\\\" data-cke-widget-wrapper=\\\"1\\\" data-cke-filter=\\\"off\\\" class=\\\"cke_widget_wrapper cke_widget_block cke_widget_inlineimage cke_widget_wrapper_webPartInRteInlineImage cke_widget_wrapper_webPartInRteClear cke_widget_wrapper_webPartInRte cke_widget_wrapper_webPartInRteAlignLeft\\\" data-cke-display-name=\\\"div\\\" data-cke-widget-id=\\\"0\\\" role=\\\"region\\\" aria-label=\\\"Inline image in RTE. Use Alt + F11 to go to toolbar. Use Alt + P to open the property pane.\\\" contenteditable=\\\"false\\\"><div data-webpart-id=\\\"image\\\" class=\\\"webPartInRte webPartInRteClear webPartInRteInlineImage cke_widget_element webPartInRteAlignLeft\\\" data-cke-widget-data=\\\"%7B%22classes%22%3A%7B%22webPartInRteInlineImage%22%3A1%2C%22webPartInRteClear%22%3A1%2C%22webPartInRteAlignCenter%22%3A1%2C%22webPartInRte%22%3A1%7D%7D\\\" data-cke-widget-upcasted=\\\"1\\\" data-cke-widget-keep-attr=\\\"0\\\" data-widget=\\\"inlineimage\\\" data-instance-id=\\\"3867d793-7562-4f3d-8913-7fb431a26f59\\\" title=\\\"\\\" contenteditable=\\\"false\\\"></div></div><p>@{replace(body('Html_to_text'), decodeuricomponent('%0A'), '')}<br></p>\"},{\"controlType\":0,\"pageSettingsSlice\":{\"isDefaultDescription\":true,\"isDefaultThumbnail\":true,\"isSpellCheckEnabled\":true}}]","PageRenderingState":{"canvasState":{"selection":{"layoutIndex":1,"zoneIndex":1,"control":{"type":4,"id":"1212fc8d-dd6b-408a-8d5d-9f1cc787efbb","selectionRange":{"start":36,"startContainerPath":[0,2],"end":36,"endContainerPath":[0,2],"text":""}}}}},"AuthorByline":["i:0#.f|membership|@{outputs('Get_my_profile_(V2)')?['body/mail']}"],"TopicHeader":"","BannerImageUrl":"","Title":"@{triggerOutputs()?['body/Title_x002f_Name']}"}

     

    image250x250_embed.png

  • knishal Profile Picture
    185 on at

    Hi @Expiscornovus  what action do i have to use to get those variables? Im getting the follow alert:

    knishal_0-1664973018427.png

    knishal_1-1664973066222.png

     

     

  • Expiscornovus Profile Picture
    34,005 Most Valuable Professional on at

    Hi @knishal,

     

    These are four initialize variables actions.

     

    You can either create those too, or just replace them by the specific guids of your file (and its related siteid, listid and relativeserverurl).

  • knishal Profile Picture
    185 on at

    Hi @Expiscornovus  Do I have create it like below:

    knishal_0-1664977238105.png

     

    If I paste the code as it is, I am getting the following:

    knishal_1-1664977302369.png

     

  • Expiscornovus Profile Picture
    34,005 Most Valuable Professional on at

    Hi @knishal,

     

    This actions are just used as an example to highlight which elements you need to replace with your variables. You do not have to reuse them, they are optional.

     

    With the actions/variables:

     

    variablesactionsoptional.png

     

    Without the actions/variables (just simple find and replace the values directly in the json).

     

    {"__metadata":{"type":"SP.Publishing.SitePage"},"CanvasContent1":"[{\"position\":{\"controlIndex\":0,\"sectionIndex\":1,\"sectionFactor\":12,\"zoneIndex\":1,\"layoutIndex\":1},\"webPartData\":{\"id\":\"d1d91016-032f-456d-98a4-721247c305e8\",\"instanceId\":\"3867d793-7562-4f3d-8913-7fb431a26f59\",\"title\":\"Image\",\"description\":\"Add an image, picture or photo to your page including text overlays and ability to crop and resize images.\",\"audiences\":[],\"serverProcessedContent\":{\"htmlStrings\":{},\"searchablePlainTexts\":{},\"imageSources\":{\"imageSource\":\"/sites/yoursitename/Shared%20Documents/1st.jpg\"},\"links\":{},\"customMetadata\":{\"imageSource\":{\"siteId\":\"0b11c57d-ef88-46d7-9743-8e800c507595\",\"webId\":\"af1a15c6-956b-4652-b8f8-869836e4e6ee\",\"listId\":\"ded07cff-9dc4-4094-a712-1a2474cf8641\",\"uniqueId\":\"e93b7365-0b0c-4bef-983c-c6c5fa48d830\",\"width\":250,\"height\":250}}},\"dataVersion\":\"1.9\",\"properties\":{\"id\":\"fc44c6a4-1932-4017-b477-75be978a610a\",\"linkUrl\":\"\",\"isInlineImage\":true,\"siteId\":\"0b11c57d-ef88-46d7-9743-8e800c507595\",\"webId\":\"af1a15c6-956b-4652-b8f8-869836e4e6ee\",\"listId\":\"ded07cff-9dc4-4094-a712-1a2474cf8641\",\"uniqueId\":\"e93b7365-0b0c-4bef-983c-c6c5fa48d830\",\"imgHeight\":250,\"imgWidth\":250,\"imageSourceType\":2,\"alignment\":\"Left\",\"fileName\":\"image250x250.png\",\"fixAspectRatio\":false,\"overlayText\":\"\",\"altText\":\"\"}},\"controlType\":3,\"id\":\"3867d793-7562-4f3d-8913-7fb431a26f59\",\"webPartId\":\"d1d91016-032f-456d-98a4-721247c305e8\",\"rteInstanceId\":\"1212fc8d-dd6b-408a-8d5d-9f1cc787efbb\",\"addedFromPersistedData\":true,\"reservedHeight\":276,\"reservedWidth\":250},{\"controlType\":4,\"id\":\"1212fc8d-dd6b-408a-8d5d-9f1cc787efbb\",\"position\":{\"controlIndex\":2,\"sectionIndex\":1,\"sectionFactor\":12,\"zoneIndex\":1,\"layoutIndex\":1},\"addedFromPersistedData\":true,\"innerHTML\":\"<p><br></p><div tabindex=\\\"-1\\\" data-cke-widget-wrapper=\\\"1\\\" data-cke-filter=\\\"off\\\" class=\\\"cke_widget_wrapper cke_widget_block cke_widget_inlineimage cke_widget_wrapper_webPartInRteInlineImage cke_widget_wrapper_webPartInRteClear cke_widget_wrapper_webPartInRte cke_widget_wrapper_webPartInRteAlignLeft\\\" data-cke-display-name=\\\"div\\\" data-cke-widget-id=\\\"0\\\" role=\\\"region\\\" aria-label=\\\"Inline image in RTE. Use Alt + F11 to go to toolbar. Use Alt + P to open the property pane.\\\" contenteditable=\\\"false\\\"><div data-webpart-id=\\\"image\\\" class=\\\"webPartInRte webPartInRteClear webPartInRteInlineImage cke_widget_element webPartInRteAlignLeft\\\" data-cke-widget-data=\\\"%7B%22classes%22%3A%7B%22webPartInRteInlineImage%22%3A1%2C%22webPartInRteClear%22%3A1%2C%22webPartInRteAlignCenter%22%3A1%2C%22webPartInRte%22%3A1%7D%7D\\\" data-cke-widget-upcasted=\\\"1\\\" data-cke-widget-keep-attr=\\\"0\\\" data-widget=\\\"inlineimage\\\" data-instance-id=\\\"3867d793-7562-4f3d-8913-7fb431a26f59\\\" title=\\\"\\\" contenteditable=\\\"false\\\"></div></div><p>TestPage<br></p>\"},{\"controlType\":0,\"pageSettingsSlice\":{\"isDefaultDescription\":true,\"isDefaultThumbnail\":true,\"isSpellCheckEnabled\":true}}]","PageRenderingState":{"canvasState":{"selection":{"layoutIndex":1,"zoneIndex":1,"control":{"type":4,"id":"1212fc8d-dd6b-408a-8d5d-9f1cc787efbb","selectionRange":{"start":36,"startContainerPath":[0,2],"end":36,"endContainerPath":[0,2],"text":""}}}}},"AuthorByline":["i:0#.f|membership|johndoe@contoso.onmicrosoft.com"],"TopicHeader":"","BannerImageUrl":"","Title":"@{triggerOutputs()?['body/Title_x002f_Name']}"}

     

  • knishal Profile Picture
    185 on at

    Ok I see, how are u getting the siteID, Webid Etc? Shouldnt it be Dynamic? 

     

  • Expiscornovus Profile Picture
    34,005 Most Valuable Professional on at

    Hi @knishal,

     

    It depends on your requirements really 😁

     

    If you want to reuse the same image that would not be needed.

     

    If you are using different images every single time I would recommend that dynamic approach. You could retrieve these details with some additional REST API HTTP requests. 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 298 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 289

#3
Henil Profile Picture

Henil 125

Last 30 days Overall leaderboard