cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
Reply
schao
Regular Visitor

Submitted Forms responses to populate Modern SharePoint Pages

Hi,

I'm new to Power Automate and created a flow to get Microsoft Forms responses submitted to create a SharePoint page  (based on a pre-created page template) on a Modern Communication SharePoint Site; essentially following the step-by-step instruction from this tutorial: https://www.youtube.com/watch?v=QtBqeEEOgdE.

full-flow.png

My Forms has a question "Session description" that is a long text answer field and the text of the submitted response will then placed into a modern text webpart of the SharePoint page via the "Save Page - https POST" step: 

 

automate-sharepoint-https-post.png

 

However, I find that whenever the submitter include a "linebreak/next line" in their Forms response, the "Save Page - https POST" step fails and the error message I get is "BadGateway" with the message:

automate-raw-output.png

"There was an error deserializing the object of type Microsoft.SharePoint.Publishing.SitePageFieldsData. Encountered invalid character '\n'.....". Upon looking at the raw input message of that step, I see that there are these "\n" characters that are automatically injected between the sentences, which upon testing is confirmed to be when the submitter line break their text when typing out their responses in Forms.

automate-body.png

 

automate-forms-response-linebreak.png

 

I've tried looking up forums but haven't come across any resources that seem to be identical to my problem. Any help to how to clear these '\n' characters would be much appreciated, since my flow has had more Failed runs than Successful runs so far due to this error. Thank you so much!

1 ACCEPTED SOLUTION

Accepted Solutions

Try solution given in this thread...

https://powerusers.microsoft.com/t5/Building-Flows/Replace-Newline-in-Flow-Expression/td-p/57333

 

uriComponentToString(replace(uriComponent(body('Html_to_text')), '\n', ''))
Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community

View solution in original post

6 REPLIES 6
PrasadAthalye
Community Champion
Community Champion

Can you replace line break character like below?

 

replace(variables('Melcode'), '\n', '')
OR
replace(variables('Melcode'), '\n', '<br>')
Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
schao
Regular Visitor

Hi PrasedAthalye,

 

Thanks for the tip!

 

I've tried replace expression, but the '\n' seem to be displayed only in the "Show raw input/output" and therefore it doesn't seem to be selected and replaced.

 

Screen Shot 2021-04-22 at 3.34.24 PM.png

 

 

 

 

As a test, I tried the following to see if maybe the way I wrote the expression is incorrect. - the following does work.

replace(outputs('Get_response_details')?['body/rd47ed83d812c4fbfabccdbba54g913gh'], 'lorem ipsum', 'LOREM IPSUM')

  

However when the latter part is changed to '\n' - it doesn't work.

replace(outputs('Get_response_details')?['body/rd47ed83d812c4fbfabccdbba54g913gh'], '\n', 'WHATEVER')

 

I have no idea how to replace the \n that's seen only in the raw data.....

OK. Can you use HTML to text action first to convert entire HTML to a text format and then use replace on it?

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
schao
Regular Visitor

Unfortunately, still not working.

I thought HTML to text fixes it, until I saw that its' raw outputs added "\n" to where the text line break to the next line in the body šŸ™„, which when I do the Replace expression, it still not be detected as these new "\n" is also only seen in the raw outputs.... 

 

Screen Shot 2021-04-23 at 11.45.34 AM.png

 

Screen Shot 2021-04-23 at 11.49.13 AM.png

 

 

 

Try solution given in this thread...

https://powerusers.microsoft.com/t5/Building-Flows/Replace-Newline-in-Flow-Expression/td-p/57333

 

uriComponentToString(replace(uriComponent(body('Html_to_text')), '\n', ''))
Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
schao
Regular Visitor

Thank you so much for this, this does the trick!!

Although it seems like the "\n" character is seen as "%0A", so I just made the slight adjustment with your suggested expression. I tested without using "Html to text" too, and the following seems to work as expected. I could probably clean up the expression nicer with additional variables.

 

uriComponentToString(replace(uriComponent(outputs('Get_response_details')?['body/rd47ed83d812c4fbfabccdbba54g913gh']), '%0A', '<br>'))

 

With that, it then put the text onto the page with the intended <br> as the originally submitted response thru the Microsoft Forms:

Screen Shot 2021-04-26 at 11.36.13 AM.png

Again, I really appreciate your help and troubleshooting with this! 

Helpful resources

Announcements

Community Roundup: A Look Back at Our Last 10 Tuesday Tips

As we continue to grow and learn together, it's important to reflect on the valuable insights we've shared. For today's #TuesdayTip, we're excited to take a moment to look back at the last 10 tips we've shared in case you missed any or want to revisit them.Ā Thanks for your incredible support for this series--we're so glad it was able to help so many of you navigate your community experience! Ā  Getting Started in the Community An overview of everything you need to know about navigating the community on one page!Ā  Community Links:Ā ā—‹Ā Power AppsĀ ā—‹Ā Power AutomateĀ Ā ā—‹Ā Power PagesĀ Ā ā—‹Ā Copilot StudioĀ  Ā  Community Ranks and YOU Have you ever wondered how your fellow community members ascend the ranks within our community? We explain everything about ranks and how to achieve points so you can climb up in the rankings! Community Links:Ā ā—‹Ā Power AppsĀ ā—‹Ā Power AutomateĀ Ā ā—‹Ā Power PagesĀ Ā ā—‹Ā Copilot StudioĀ  Ā  Powering Up Your Community Profile Your Community User Profile is how the Community knows you--so it's essential that it works the way you need it to! From changing your username to updating contact information, this Knowledge Base Article is your best resource for powering up your profile. Community Links:Ā ā—‹Ā Power AppsĀ ā—‹Ā Power AutomateĀ Ā ā—‹Ā Power PagesĀ Ā ā—‹Ā Copilot StudioĀ  Ā  Community Blogs--A Great Place to Start There's so much you'll discover in the Community Blogs, and we hope you'll check them out today!Ā  Community Links:Ā ā—‹Ā Power AppsĀ ā—‹Ā Power AutomateĀ Ā ā—‹Ā Power PagesĀ Ā ā—‹Ā Copilot StudioĀ  Ā  Unlocking Community Achievements and Earning Badges Across the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions.Ā Check out some details on Community badges--and find out more in the detailed link at the end of the article! Community Links:Ā ā—‹Ā Power AppsĀ Ā ā—‹Ā Power AutomateĀ Ā ā—‹Ā Power PagesĀ Ā ā—‹Ā Copilot StudioĀ  Ā  Blogging in the Community Interested in blogging? Everything you need to know on writing blogs in our four communities! Get started blogging across the Power Platform communities today! Community Links:Ā ā—‹Ā Power AppsĀ Ā ā—‹Ā Power AutomateĀ Ā ā—‹Ā Power PagesĀ Ā ā—‹Ā Copilot Studio Ā  Subscriptions & Notifications We don't want you to miss a thing in the community! Read all about how to subscribe to sections of our forums and how to setup your notifications! Community Links:Ā ā—‹Ā Power AppsĀ Ā ā—‹Ā Power AutomateĀ Ā ā—‹Ā Power PagesĀ Ā ā—‹Ā Copilot Studio Ā  Getting Started with Private Messages & Macros Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member! Community Links:Ā ā—‹Ā Power AppsĀ Ā ā—‹Ā Power AutomateĀ Ā ā—‹Ā Power PagesĀ Ā ā—‹Ā Copilot Studio Ā  Community User Groups Learn everything about being part of, starting, or leading a User Group in the Power Platform Community. Community Links:Ā ā—‹Ā Power AppsĀ Ā ā—‹Ā Power AutomateĀ Ā ā—‹Ā Power PagesĀ Ā ā—‹Ā Copilot Studio Ā  Update Your Community Profile Today! Keep your community profile up to date which is essential for staying connected and engaged with the community. Community Links:Ā ā—‹Ā Power AppsĀ Ā ā—‹Ā Power AutomateĀ Ā ā—‹Ā Power PagesĀ Ā ā—‹Ā Copilot Studio Ā  Thank you for being an integral part of our journey. Ā  Here's to many more Tuesday Tips as we pave the way for a brighter, more connected future! As always, watch theĀ News & AnnouncementsĀ for the next set of tips, coming soon! Ā  Ā 

Calling all User Group Leaders and Super Users! Mark Your Calendars for the next Community Ambassador Call on May 9th!

This month's Community Ambassador call is on May 9th at 9a & 3p PDT. Please keep an eye out in your private messages and Teams channels for your invitation. There are lots of exciting updates coming to the Community, and we have some exclusive opportunities to share with you! As always, we'll also review regular updates for User Groups, Super Users, and share general information about what's going on in the Community. Ā  Ā  Be sure to register & we hope to see all of you there!

April 2024 Community Newsletter

We're pleased to share theĀ April CommunityĀ Newsletter,Ā where we highlight the latest news, product releases, upcoming events, and the amazing work of our outstanding Community members. Ā  If you're new to the Community, please make sure to follow the latestĀ News & AnnouncementsĀ and check out theĀ Community on LinkedInĀ as well! It's the best way to stay up-to-date with all the news from across Microsoft Power Platform and beyond.Ā  Ā  COMMUNITY HIGHLIGHTS Ā  Check out the most active community members of the last month! These hardworking members are posting regularly, answering questions, kudos, and providing top solutions in their communities. We are so thankful for each of you--keep up the great work! If you hope to see your name here next month, follow these awesome community members to see what they do! Ā  Power AppsPower AutomateCopilot StudioPower PagesWarrenBelzDeenujialexander2523ragavanrajanLaurensMManishSolankiMattJimisonLucas001AmikcapuanodanilostephenrobertOliverRodriguestimlAndrewJManikandanSFubarmmbr1606VishnuReddy1997theMacResolutionsVishalJhaveriVictorIvanidzejsrandhawahagrua33ikExpiscornovusFGuerrero1PowerAddictgulshankhuranaANBExpiscornovusprathyooSpongYeNived_Nambiardeeksha15795apangelesGochixgrantjenkinsvasu24Mfon Ā  LATEST NEWS Ā  Business Applications Launch Event - On Demand In case you missed the Business Applications Launch Event, you can now catch up on all the announcements and watch the entire event on-demand insideĀ Charles Lamanna's latest cloud blog. Ā  This is your one stop shop for all the latest Copilot features across Power Platform andĀ #Dynamics365, including first-hand looks at how companies such asĀ Lenovo,Ā Sonepar,Ā Ford Motor Company,Ā OmnicomĀ and more are using these new capabilities in transformative ways.Ā Click the image belowĀ to watch today! Ā  Power Platform Community Conference 2024 is here! It's time to look forward to the next installment of the Power Platform Community Conference, which takes place this year onĀ 18-20th September 2024Ā at the MGM Grand in Las Vegas! Ā  Come and be inspired by Microsoft senior thought leaders and the engineers behind theĀ #PowerPlatform, withĀ Charles Lamanna,Ā Sangya Singh,Ā Ryan Cunningham,Ā Kim Manis,Ā Nirav Shah,Ā Omar AftabĀ andĀ Leon WelickiĀ already confirmed to speak. You'll also be able to learn from industry experts and Microsoft MVPs who are dedicated to bridging the gap between humanity and technology. These include the likes ofĀ Lisa Crosbie,Ā Victor Dantas,Ā Kristine Kolodziejski,Ā David Yack,Ā Daniel Christian,Ā Miguel FĆ©lix, andĀ Mats Necker, with many more to be announced over the coming weeks. Ā  Click hereĀ to watch our brand-new sizzle reel forĀ #PPCC24Ā orĀ click the image belowĀ to find out more about registration. See you in Vegas! Ā  Ā  Ā  Power Up Program Announces New Video-Based Learning Hear from Principal Program Manager,Ā Dimpi Gandhi, to discover the latest enhancements to the MicrosoftĀ #PowerUpProgram. These include a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs,Ā Rory NearyĀ andĀ Charlie Phipps-Bennett. If youā€™d like to hear whatā€™s coming next,Ā click the image belowĀ to find out more! Ā  UPCOMING EVENTS Microsoft Build - Seattle and Online - 21-23rd May 2024 Taking place onĀ 21-23rd May 2024Ā both online and in Seattle, this is the perfect event to learn more about low code development, creating copilots, cloud platforms, and so much more to help you unleash the power of AI. Ā  There's a serious wealth of talent speaking across the three days, including the likes ofĀ Satya Nadella,Ā Amanda K. Silver,Ā Scott Guthrie,Ā Sarah Bird,Ā Charles Lamanna,Ā Miti J.,Ā Kevin Scott,Ā Asha Sharma,Ā Rajesh Jha,Ā Arun Ulag,Ā Clay Wesener, and many more. Ā  And don't worry if you can't make it to Seattle, the event will be online and totally free to join.Ā Click the image belowĀ to register forĀ #MSBuildĀ today! Ā  European Collab Summit - Germany - 14-16th May 2024 The clock is counting down to the amazingĀ European Collaboration Summit, which takes place in GermanyĀ May 14-16, 2024.Ā #CollabSummit2024Ā is designed to provide cutting-edge insights and best practices into Power Platform, Microsoft 365, Teams, Viva, and so much more. There's a whole host of experts speakers across the three-day event, including the likes ofĀ Vesa Juvonen,Ā Laurie Pottmeyer,Ā Dan Holme,Ā Mark Kashman,Ā Dona Sarkar,Ā Gavin Barron,Ā Emily Mancini,Ā Martina Grom,Ā Ahmad Najjar,Ā Liz Sundet,Ā Nikki Chapple,Ā Sara Fennah,Ā Seb Matthews,Ā Tobias Martin,Ā Zoe Wilson,Ā Fabian Williams, and many more. Ā  Click the image belowĀ to find out more aboutĀ #ECS2024Ā and register today! Ā  Ā  Microsoft 365 & Power Platform Conference - Seattle - 3-7th June If you're looking to turbo boost your Power Platform skills this year, why not take a look at everythingĀ TechCon365Ā has to offer at theĀ Seattle Convention CenterĀ onĀ June 3-7, 2024. Ā  This amazing 3-day conference (with 2 optional days of workshops) offers over 130 sessions across multiple tracks, alongside 25 workshops presented by Power Platform, Microsoft 365, Microsoft Teams, Viva, Azure, Copilot and AI experts. There's a great array of speakers, including the likes ofĀ Nirav Shah,Ā Naomi Moneypenny,Ā Jason Himmelstein,Ā Heather Cook,Ā Karuana Gatimu,Ā Mark Kashman,Ā Michelle Gilbert,Ā Taiki Y.,Ā Kristi K.,Ā Nate Chamberlain,Ā Julie Koesmarno,Ā Daniel Glenn,Ā Sarah Haase,Ā Marc Windle,Ā Amit Vasu,Ā Joanne C Klein,Ā Agnes Molnar, and many more. Ā  Click the image belowĀ for moreĀ #Techcon365Ā intel and register today! Ā  Ā  For more events,Ā click the image belowĀ to visit the Microsoft Community Days website. Ā  Ā  Ā 

Tuesday Tip | Update Your Community Profile Today!

It's time for anotherĀ TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether youā€™re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community. Ā  We're excited to announce that updating your community profile has never been easier! Keeping your profile up to date is essential for staying connected and engaged with the community. Ā  Check out the following Support Articles with these topics: Accessing Your Community ProfileRetrieving Your Profile URLUpdating Your Community Profile Time ZoneChanging Your Community Profile Picture (Avatar)Setting Your Date Display Preferences Click on your community link for more information: Power Apps,Ā Power Automate,Ā Power Pages,Ā Copilot Studio Ā  Thank you for being an active part of our community. Your contributions make a difference! Best Regards, The Community Management Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager,Ā Dimpi Gandhi, to discover the latest enhancements to the MicrosoftĀ #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs,Ā Rory NearyĀ andĀ Charlie Phipps-Bennett. If youā€™d like to hear whatā€™s coming next, click the link below to sign up today!Ā https://aka.ms/PowerUp Ā 

Super User of the Month | Ahmed Salih

We're thrilled to announce thatĀ Ahmed SalihĀ is our Super User of the Month for April 2024. Ahmed has been one of our most active Super Users this year--in fact, he kicked off the year in our Community with this great video reminder of why being a Super User has been so important to him! Ā  Ahmed is the Senior Power Platform Architect at Saint Jude's Children's Research Hospital in Memphis. He's been a Super User for two seasons and is also a Microsoft MVP! He's celebrating his 3rd year being active in the Community--and he's received more than 500 kudos while authoring nearly 300 solutions. Ahmed's contributions to the Super User in Training program has been invaluable, with his most recent session with SUIT highlighting an incredible amount of best practices and tips that have helped him achieve his success. Ā  Ahmed's infectious enthusiasm and boundless energy are a key reason why so many Community members appreciate how he brings his personality--and expertise--to every interaction. With all the solutions he provides, his willingness to help the Community learn more about Power Platform, and his sheer joy in life, we are pleased to celebrate Ahmed and all his contributions! You can find him in the Community and on LinkedIn. Congratulations, Ahmed--thank you for being a SUPER user!

Users online (4,486)