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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Send an HTTP Request t...
Power Automate
Unanswered

Send an HTTP Request to SharePoint: Body formatting

(0) ShareShare
ReportReport
Posted on by

I'm trying to recreate a Designer 2010 workflow in Power Automate, since they are being deprecated.  I need to send an email to multiple SP groups upon file upload to a specific directory in a library.  I don't want to do all of that Initialize Variables and Parsing JSON nonsense.  It should - IT NEEDS - to be easier than that, imho.  So, I have all of that figured out by using the Send an HTTP Request to SharePoint step in Power Automate.  But I am not familiar with the JSON syntax needed to format the body as HTML or Rich Text style markup.  Is there a reference for this?  Bold, bold red, hyperlinks, etc.  Thanks in advance-

Categories:
I have the same question (0)
  • PrasadAthalye Profile Picture
    on at

    JSON Syntax can be plain text. Which API are you calling? If you are querying the site group you can find details in the below thread...

    https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/SharePoint-Group-Operations-in-Microsoft-Flow/ba-p/394446

     

  • Community Power Platform Member Profile Picture
    on at

    The Uri is /_api/SP.Utilities.Utility.SendEmail

     

    The link you included doesn't appear to have syntax reference, only Initialize Variables and Parse JSON things.  When you say 'plain text', are you saying that I cannot format the text in the Body of an email composed in the Send an HTTP Request to SharePoint action step?  I see paragraph tags <p> </p> in the sample I followed online.  I'd like to markup using HTML, but I keep getting an error like this one:

     

    Not well formatted JSON stream.
    clientRequestId: cd2a187f-f558-4ac2-883e-cefbfa4eab79
    serviceRequestId: b20caf9f-a00f-b000-a6fe-ba70c8dece45

  • PrasadAthalye Profile Picture
    on at

    Ok, Understood. Can you please refer below? You can put your body HTML in the body tag within single quotes...

     

    {
    'properties': {
    'To': ['p@p.com','y@y.com'],
    'Body': '<b>Yo</b><br/>O boy!',
    'Subject': 'E-mail using Flow via SharePoint'
    }
    }

     

    PrasadAthalye_1-1614351309925.png

     

     

  • Community Power Platform Member Profile Picture
    on at

    I did that and it throws the error.  Maybe my HTML is of the wrong version?  Here's my code:

     

    {
    'properties': {
    '__metadata': {
    'type': 'SP.Utilities.EmailProperties'
    },

    'To': {
    'results': ['SP_Group_DEV', 'SP Group_DEV2']
    },
    'Body': '

    <p><span
    style='font-size:10.0pt;line-height:115%;font-family:"Arial",sans-serif;
    color:black'>The most recent list of special requests in which your
    distributors have made Out-of-APR sales considered In-APR is now available on
    the NA Channel Management SharePoint site.&nbsp; The Territory Sales Manager
    needs to validate the request and edit the appropriate columns in the file.</span></p>

    <p><b><span
    style='font-size:10.0pt;line-height:115%;font-family:"Arial",sans-serif;
    color:black'>For every request that affects your distributor you need to either
    &quot;Approve&quot; or &quot;Reject&quot; each transaction in Column A of the
    spreadsheet.&nbsp; Remember to add your name to Column B and the date in Column
    C as well.</span></b></p>

    <p><b><span
    style='font-size:10.0pt;line-height:115%;font-family:"Arial",sans-serif;
    color:red'>Please validate these in a timely manner, if you don't the
    transaction will not be processed in SAP and could have an unintended result on
    your distributor's CPM report.&nbsp; </span></b><span style='font-size:10.0pt;
    line-height:115%;font-family:"Arial",sans-serif;color:black'>Once validated the
    Territory Sales Manager should click "Save" in the top left.&nbsp; </span></p>

    <p><span
    style='font-size:10.0pt;line-height:115%;font-family:"Arial",sans-serif;
    color:black'>If this list does not include any distributor requests for the
    distributors you are responsible for, please disregard.</span></p>

    <p><span
    style='font-size:10.0pt;font-family:"Arial",sans-serif;color:black'>Please&nbsp;</span><a
    href="https://link.com">

    <span
    style='font-size:10.0pt;font-family:"Arial",sans-serif;color:blue'>click here</span></a><span
    style='font-size:10.0pt;font-family:"Arial",sans-serif;color:black'>&nbsp;to
    see the list of requests.</span></p>

    <p><span
    style='font-size:10.0pt;line-height:115%;font-family:"Arial",sans-serif'>Thank
    you,</span></p>

    <p><span
    style='font-size:10.0pt;font-family:"Arial",sans-serif'>Name</span></p>

    <p>>&nbsp;</p>

    </div>',

    'Subject': 'Test email from MS Flow'
    } }

  • shoaibsam12 Profile Picture
    24 on at

    @Anonymous  Did you find the solution to this issue?

  • Bobron Profile Picture
    128 on at

    Probably not relevant anymore, but i'll post it for anyone also having the same issue.

     

    When trying to send an email from SharePoint site as no-reply with the send an HTTP request action, I've gotten the same error as above.

     

    I found out that there is some degree of rich text formatting possible.

    I've got zero experience with coding and I'm not an IT guy, but when eliminating some formatting piece by piece and just keep testing what works, I've gotten it to work .

     

    Starting the body like this: "Body":"[input_text]"

    formatting like <br> <strong> <u> etc. works for me.

    Formatting like <span style="color: rgb(26,188,156)"> doesn't work for me, error.

    Formatting like <span style='color: rgb(26,188,156)'> Works for me.

     

    Don't know if it's true, but it seems like the special characters used in the body can't be the same as the opening and closing characters of the body itself.

     

    I don't know how and why, but maybe for someone it is useful.

     

    I hope this helps for anyone in the future.

  • Mojojojo_2020 Profile Picture
    2 on at

    Hi @Anonymous ,

    I have exactly the same problem, did you find any solution or workaround?

  • Enjadah Profile Picture
    5 on at

    Thanks @Bobron !

     

    It actually works ! Seems that JSON are not able to distinguish the annotation between HTML and JSON format. So, you'll need to change all the double quote mark inside the HTML code with a single quote mark. 

     

    Cheers.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard