cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Problems creating a news post when a list item is created

I found this solved post about creating a news post when a list item is created and am trying to implement it. Screenshots of my entire flow are below. But I'm running into two issues. 

  1. Every time I run the flow, two pages are created. I'll get something like Test 01.aspx and Test–01.aspx
  2. Every time I run the flow and have dynamic content in the 'innerHTML' (the yellow highlighted part in the second screenshot) the flow fails at the last action. I get a BadGateway error. Below the screenshots is the output of the error.

Any insight would be appreciated.

 

Tagging @Expiscornovus since he created the original solution I'm working off of.

 

Picture001.png

 

 

Picture002.png

 

{
    "statusCode": 502,
    "headers": {
        "Pragma": "no-cache",
        "Cache-Control": "no-store, no-cache",
        "Set-Cookie": "ARRAffinity=fa5ce4b13622b0d3617b4398e823c470b20f49c8905d33671c1e72b454b4c01b;Path=/;HttpOnly;Secure;Domain=sharepointonline-ncus.azconn-ncus-001.p.azurewebsites.net,ARRAffinitySameSite=fa5ce4b13622b0d3617b4398e823c470b20f49c8905d33671c1e72b454b4c01b;Path=/;HttpOnly;SameSite=None;Secure;Domain=sharepointonline-ncus.azconn-ncus-001.p.azurewebsites.net",
        "x-ms-datasourceerror": "True",
        "x-ms-request-id": "2b11b8a0-d019-3000-a9e0-810ec1592287",
        "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
        "X-Content-Type-Options": "nosniff",
        "X-Frame-Options": "DENY",
        "Timing-Allow-Origin": "*",
        "x-ms-apihub-cached-response": "true",
        "x-ms-apihub-obo": "false",
        "Date": "Tue, 30 May 2023 23:02:17 GMT",
        "Content-Length": "750",
        "Content-Type": "application/json",
        "Expires": "-1"
    },
    "body": {
        "error": {
            "code": 502,
            "source": "flow-apim-msmanaged-na-westus2-01.azure-apim.net",
            "clientRequestId": "cb13ed9a-55ed-4af3-ad26-2be8e6a95c2c",
            "message": "BadGateway",
            "innerError": {
                "status": 502,
                "message": "There was an error deserializing the object of type Microsoft.SharePoint.Publishing.SitePageFieldsData. Encountered unexpected character 'E'.\r\nclientRequestId: cb13ed9a-55ed-4af3-ad26-2be8e6a95c2c\r\nserviceRequestId: 2b11b8a0-d019-3000-a9e0-810ec1592287",
                "source": "https://salemhealth.sharepoint.com/sites/Daily_Dose/_api/sitepages/pages(367)/SavePageAsDraft",
                "errors": [
                    "-1",
                    "System.Runtime.Serialization.SerializationException"
                ]
            }
        }
    }
}

 

9 REPLIES 9
Expiscornovus
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous,

 

Are you escaping the quotes in the dynamic content you are using within the innerHTML property? Can you also share the HTML you are using in your test?



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #MicrosoftCopilotStudio content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Anonymous
Not applicable

Hi @Expiscornovus,

 

I believe I'm escaping the quotes... Below is everything within the 'body' field, including dynamic content within the innerHTML property.

 

At this point, I'm testing the flow with text only in the SharePoint list form — so the html I'm using is something like <div>Lorem ipsum</div> or <p>Lorem ipsum</p>.

 

{
   "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/f9acda13-4460-426f-b4d9-5fb9b34b47d0/613871602_super.jpg\"},\"links\":{},\"customMetadata\":{\"imageSource\":{\"width\":2048,\"height\":1152}}},\"dataVersion\":\"1.4\",\"properties\":{\"imageSourceType\":2,\"title\":\"@{triggerOutputs()?['body/Title']}\",\"textAlignment\":\"Left\",\"showPublishDate\":true,\"authors\":[],\"showTopicHeader\":true,\"authorByline\":[],\"layoutType\":\"FullWidthImage\",\"titlePlaceholder\":\"Name your news post\",\"topicHeader\":\"News & Notices\",\"enableGradientEffect\":true,\"imgHeight\":1152,\"imgWidth\":2048,\"translateX\":58.70870870870871,\"translateY\":49.122807017543856},\"containsDynamicDataSource\":false,\"reservedHeight\":228}]",
   "CanvasContent1":"[{\"controlType\":4,\"id\":\"1212fc8d-dd6b-408a-8d5d-9f1cc787efbb\",\"position\":{\"controlIndex\":1,\"sectionIndex\":1,\"sectionFactor\":8,\"zoneIndex\":1,\"layoutIndex\":1},\"addedFromPersistedData\":true,\"innerHTML\":\"@{triggerOutputs()?['body/Article']}\"},{\"position\":{\"controlIndex\":1,\"sectionIndex\":2,\"sectionFactor\":4,\"zoneIndex\":1,\"layoutIndex\":1},\"controlType\":3,\"id\":\"1856c2ad-84c5-43c3-8f12-f353dbbd8f5b\",\"webPartId\":\"8c88f208-6c77-4bdb-86a0-0c47b4316588\",\"reservedHeight\":424,\"reservedWidth\":364,\"addedFromPersistedData\":true,\"webPartData\":{\"id\":\"8c88f208-6c77-4bdb-86a0-0c47b4316588\",\"instanceId\":\"1856c2ad-84c5-43c3-8f12-f353dbbd8f5b\",\"title\":\"News\",\"description\":\"Show news posts from one or more sites in a variety of layouts. You can filter news and target news to key audiences.\",\"audiences\":[],\"serverProcessedContent\":{\"htmlStrings\":{},\"searchablePlainTexts\":{\"title\":\"Latest news\"},\"imageSources\":{},\"links\":{\"baseUrl\":\"https://---redacted---.com/sites/--redacted--\"}},\"dataVersion\":\"1.12\",\"properties\":{\"carouselSettings\":{\"autoplay\":false,\"autoplaySpeed\":5,\"dots\":true,\"lazyLoad\":true,\"metadata\":true,\"swipe\":true,\"useStockItems\":false},\"showChrome\":true,\"showNewsMetadata\":{\"showSocialActions\":false,\"showAuthor\":false,\"showDate\":true},\"layoutId\":\"ListNews\",\"newsDataSourceProp\":1,\"filterKQLQuery\":\"\",\"carouselHeroWrapperComponentId\":\"\",\"prefetchCount\":6,\"filters\":[{\"filterType\":1,\"value\":\"\",\"values\":[]}],\"dataProviderId\":\"news\",\"newsSiteList\":[],\"renderItemsSliderValue\":6,\"layoutComponentId\":\"\",\"webId\":\"58859736-b09f-40df-9531-773e4f35c58b\",\"siteId\":\"90398e7f-8163-4ca7-a651-075d4b04af92\",\"pinnedItems\":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"templateId\":\"ListNews\",\"propsLastEdited\":\"2023-01-16T19:27:18.269Z\",\"compactMode\":true},\"containsDynamicDataSource\":false}},{\"controlType\":0,\"pageSettingsSlice\":{\"isDefaultDescription\":true,\"isDefaultThumbnail\":true,\"isSpellCheckEnabled\":true,\"globalRichTextStylingVersion\":1,\"rtePageSettings\":{\"contentVersion\":4},\"isEmailReady\":false}}]",
   "AuthorByline":[
      
   ],
   "TopicHeader":"News & Notices",
   "BannerImageUrl":"https://cdn.hubblecontent.osi.office.net/m365content/publish/f9acda13-4460-426f-b4d9-5fb9b34b47d0/613871602_super.jpg",
   "Title":"@{triggerOutputs()?['body/Title']}"
}
Expiscornovus
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous,

 

What settings did you use for the Article column in your source list? I used a Multiple lines of text without any additional settings (like Rich Text).

 

article_columnsettings.png

 

I just tested a similar setup and I got this as the end result.

 

loremimpsum.png

 

The payload I used is slightly different. I wanted to start simple to see if the approach still works. Maybe you can test it with the same setup?

 

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

 

Also worth mentioning is that the Content-Type header I used has the odata=nometadata value (in this test, but also in my original post back in 2021).

 

{
  "Accept": "application/json;odata=verbose",
  "Content-Type": "application/json;odata=nometadata"
}

 

savepageasdraft_repro.png



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #MicrosoftCopilotStudio content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Anonymous
Not applicable

Hi @Expiscornovus,

 

I updated my flow to match your suggested setup and tested a few times. It both worked and didn't work.

  • It worked when the Article field was set to 'Multiple Lines of Text' and 'Rich Text' was turned off.
  • It did not work when Article field was set to 'Multiple Lines of Text' and 'Rich Text' was turned on. 

 

I'm hoping to make this flow work with Rich Text turned on. I have a list of nearly 4000 items that I'm moving to a new site, and I want these 4000 items to become pages on the destination site. All these items are coming into the destination site with html in the Article field. Is this something I can accomplish with this flow?

Expiscornovus
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous,

 

Just to double check. Can you explain why that Rich Text is a requirement?

 

Earlier you shared that you where using HTML tags as input directly in the multi line field. In that case you wouldn't need Rich Text, correct?

 

In the meantime I will have a look if I can get it working with Rich Text. It might be that some conversion is required to turn the rich text into valid HTML again.



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #MicrosoftCopilotStudio content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


@Anonymous @Expiscornovus ,

 

Just wondering if you manage to solve this?

I have exactly the same issue when creating sited from list entry with Rich text

Expiscornovus
Most Valuable Professional
Most Valuable Professional

Hi @slawo88,

 

Like mentioned in my previous reply. I would suggest to use a multiples lines of text field in the CMS source list with Rich Text disabled.

 

There is no point in using Rich Text if the aim is to write the HTML yourself in the field.



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #MicrosoftCopilotStudio content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


slawo88
Frequent Visitor

@Expiscornovus , got ya,

 

I managed to store the text in table w. html tags

 

2023-08-21 18_50_37-departament-site-test - SPO Sites - All Items and 14 more pages - Work 3 - Micro.png

 

But when flow is being triggered it is giving me BadGateway error as well

 

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

 

 

slawo88
Frequent Visitor

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (1,360)