cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Michal
Kudo Collector
Kudo Collector

How to extract html body as a variable from the value in a given JSON sample

I am collecting log entries in the Team's chat and after several "Parse JSON" actions I end up with the core "Body" from the log which looks like that:

 

 

[
  {
    "name": "Module",
    "value": "<p>NewProductNotification</p>"
  },
  {
    "name": "Message",
    "value": "<p>New entity created, but could not find a child Item and cannot send a mail to the Product Owner, sending to CCAddress if applicable...</p>"
  }
]

 

 

The last mile should be straightforward: Parse JSON once more using the above data as a schema template, select from the parsed body the name and value and use them. It works for the Module but not for the Message

I tried the following method to extract the message in my sandbox without success. I tried to convert the Message to the plain text but I can see as input only <p></p>

How to get the whole piece of the Message and save it as a variable. I want to use it later to save it in the SharePoint list and also convert it to plain text. 

 1a.png

1b.png

1c.png

When the flow runs...

 

653206d0-bcb5-40d8-87c9-52791871afc5.png

2b.png

2c.png

2d.png

Any tips?

1 ACCEPTED SOLUTION

Accepted Solutions
DamoBird365
Super User
Super User

Hey @Michal 

 

Your message is in the 2nd object [1], not the first [0].  Therefore you are looking for:

 

body('select')?[1]?['message']

 

Damien

View solution in original post

1 REPLY 1
DamoBird365
Super User
Super User

Hey @Michal 

 

Your message is in the 2nd object [1], not the first [0].  Therefore you are looking for:

 

body('select')?[1]?['message']

 

Damien

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (1,860)