cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
thressac
Helper I
Helper I

Create a news post when a list item is created

Is there a flow when a new list item is created it creates a news post with the info from that list item?

23 REPLIES 23
Automaton1
Regular Visitor

Hi @Expiscornovus 

 

Your solution works!! Thank you so much.

 

I've tried to insert the banner image using the following:

{

"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\":true,\"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']} <p>Congrats, @{triggerOutputs()?['body/NominatedEmployee/DisplayName']}!!</p> @{triggerOutputs()?['body/Author/DisplayName']} has just nominated you for having these values: @{variables('SCCValues')}. <br> Here is their message: @{triggerOutputs()?['body/Reasons']}.<br>\",\"emphasis\":{}},{\"controlType\":0,\"pageSettingsSlice\":{\"isDefaultDescription\":true,\"isDefaultThumbnail\":true}}]","AuthorByline": [],"TopicHeader": "","BannerImageUrl":"https://company.sharepoint.com/sites/TestCommunicationSite/Images1/award.png","Title":"@{triggerOutputs()?['body/Title']} Congrats @{triggerOutputs()?['body/NominatedEmployee/DisplayName']}!!"}

 

On the main site, it shows up fine however not on the page itself.

Automaton1_1-1661832209007.png

 

Automaton1_0-1661832174323.png

 

Once I click on 'Page details', its showing the banner photo on the top-right.

Automaton1_0-1661836936923.png

When I click on 'Edit' to enter the edit mode on the page and click on 'page details', it shows the default banner image.

Automaton1_1-1661837035522.png

 

Any advises would be much appreciated.

 

Thanks

Lukas_SCH
New Member

Hi @Expiscornovus and @thressac,

i would like to follow your instructions as a total noob and beginner in Power Automate. i have problems with the beginning of the third HTTP Request using the right URI. Have you made or created something beforehand that is pretty obvious? Flowreader asks me to correct for valid reference. Can u help me out here?

I have gotten closer. Mine post but only show the image when I click on the news post. The thumbnail doesn't show until I click on the post again, click edit and then immediately update the post without changing anything. Then the image and thumbnail show up correctly. 

 

\"imageSources\":{\"imageSource\":\"/sites/PC/SiteAssets/SitePages/Test-Title/88339-Expired-stamp-PSD---PSDstamps.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\":\"/sites/PC/SiteAssets/SitePages/Test-Title/88339-Expired-stamp-PSD---PSDstamps.png\"},\"links\":{},\"customMetadata\":{\"imageSource\":{}}},\"dataVersion\":\"1.4\",\"properties\":{\"imageSourceType\":2,\"title\":\"Expired Forms\",\"textAlignment\":\"Left\",\"showPublishDate\":true,\"authors\":[{\"id\":\"\",\"upn\":\"\",\"email\":\"yourauthor@domain.com\",\"\":\"\",\"role\":\"\"}],\"showTopicHeader\":false,\"authorByline\":[\"\"],\"layoutType\":\"CutInShape\",\"titlePlaceholder\":\"Expired Forms\",\"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\":\"<b>The following documents are no longer active.</b><br><br>@{outputs('Compose_Table_to_String')}\",\"emphasis\":{},\"zoneGroupMetadata\":{\"type\":0}}]",
	"Title": "Forms Expired on @{body('Convert_time_zone')}"
}

 

ConstructionUse
New Member

@Expiscornovus Thanks for all of this Dennis. Have been able to publish a News Post after inputting a new Sharepoint item!

 

Not a coder though. I will simply have 5 different data entries in the sharepoint item (location, type of building, ate when the project starts, the client, ...)

 

I would want to write the copy and add that available dynamic content. 

 

Which code do I need to add so that I can type the standard message and add the dynamic content in in between the 'Body'? 

 

Alvast bedankt. No problem if there is a guide you can direct me to...also that will help. 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,782)