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

Text manipulation

I am trying to extract some values from an email that contains JSON.  The issue I am facing is that someone has added text to the top and bottom of the email.  This therefore means that if I dont remove that text the JSON functions quite rightly error.  The body of the email is as folows:

 

 

You are receiving this email to notify you about new a signup activity.

 

Customer Data:

{

  "signup_type": "test",

  "status_id": "FCE892E2-4E07-4E09-A3B4-D26B7E36C607",

  "subscription_type": "mrr",

  "sfdc_account_id": "001500000145454KAA3"

}

 

To remove yourself from these emails, please talk to your manager.

 

 

How can I remove the text from the top and bottom so that I just have the JSON?

Thanks

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Text manipulation

Hi @Anonymous,

 

 

I don't think there is a way to "Remove" the string from the Email body.

The Email Body received under Microsoft Flow would be in HTML format.

I originally thought that we could take use of the concat and the split function to work with the strings only, but the Body of the Email would contain the HTML tag, which makes it impossible for me to get it work.

You may take a look at the corresponding document for the functions used under Microsoft Flow, see if that could help:

Workflow Definition Language

Regards,

Michael

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Regular Visitor

Re: Text manipulation

You can use substring to extract text between two defined characters

 

substring(triggerBody()?['Body'],(indexOf(triggerBody()?['Body'],'{'),SUB(indexOf(triggerBody()?['Body'],'}'),(indexOf(triggerBody()?['Body'],'{')))
 
BR

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (7,343)