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 / Update Sharepoint News...
Power Automate
Answered

Update Sharepoint News Post Text via Power Automate

(2) ShareShare
ReportReport
Posted on by 10
I'm trying to create a method of creating Sharepoint News Articles via a Sharepoint list and Power Automate.
 
 
It all works until the stage to write the updates into the news article.
 
If I post the code from the payload into the "SavePageAsDraft" step the flow saves.
As soon as I add Dynamic Content into the payload (ie. the sharepoint list columns to replace my placeholders" it errors with "The input parameter(s) of operation 'Send HTTP to Sharepoint - Save Draft' contains invalid expression(s). Fix invalid expression(s) for the input parameter(s) of operation 'Send HTTP to Sharepoint - Save Draft'."
 
Send HTTP to Sharepoint - Save Draft is the name of my flow step.
 
Any ideas why this would keep erroring or how to troubleshoot because the Power Automate error message isn;t too helpful!!

TIA
Ian
Categories:
I have the same question (0)
  • Suggested answer
    Haque Profile Picture
    3,217 on at
     
    This is probably because the JSON payload is not properly formatted when mixing static text and dynamic expressions,  you are seeing the error “Send HTTP to SharePoint - Save Draft”.
     
     
    Use a Compose or Variable to Build the JSON Payload - Instead of inserting dynamic content directly inside the HTTP action’s body, first build the entire JSON payload as a string in a Compose action or a String variable.

    Suppose you want to replace placeholders with SharePoint list column values dynamically. Use the following expression:
    concat(
      '{ "field1": "', triggerOutputs()?['body/Column1'], '", ',
      '"field2": "', triggerOutputs()?['body/Column2'], '" }'
    )
    
     
    Note:  In the HTTP action’s body, use the output of the Compose action by selecting it from dynamic content. This ensures the payload is a valid JSON string.
     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!
  • IO-09070904-0 Profile Picture
    10 on at
    Thanks - I setup a variable as a string called "PageCode" and populated the page code.
    Then setup a second empty string variable called "PageCodeNew"
    Finally I created a step to set the "PageCodeNew" variable with a nested replace function to find my placeholders (identified with {{}}) and update these with the sharepoint list columns...
      replace(
        replace(
          replace(
            replace(variables('pagecode'), 
            '{{AUTHOR}}', triggerBody()?['Author/DisplayName']
            ),
          '{{SUMMARY}}', outputs('Summery_Linebreaks')
          ),
      '{{HEADER}}', triggerBody()?['Title']
      ),
    '{{ARTICLE}}', outputs('FullArticle_Linebreaks')
    )
    The last step is as HTTP to Sharepoint POST with the "body" being the PageCodeNew variable.
     
    Only bit to sort tomorrow is that one of the Placeholders is a date field, so it won;t work in the String Variable.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 791

#2
Valantis Profile Picture

Valantis 568

#3
Haque Profile Picture

Haque 535

Last 30 days Overall leaderboard