cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
darkhorse12
Helper I
Helper I

Extract Body From Mail

Hello, I am New to power automate,

 

Can you help me with this.

 

 

when email arrives ,

 

 

Requirement(Automated Clod flow)

  1. Flow will be trigger on email

  2. Flow will check keyword "Receipt #"

  3. Get value after that keyword "Receipt # 7878787"

  4. Create folder in One Drive with this number Receipt

 

 

The mail is like:

--------

the goods is submitted
 
1.invoice(CC704589654, Receipt # 568954)
 
thank you,

 --------------

 

We want to save that #(number),

 

1 ACCEPTED SOLUTION

Accepted Solutions

@darkhorse12 ,
In the substring function, you will have to provide the correct value for the last index.
 

vikulkar_0-1646073897487.png

If you reduce the number to 15, the function should ignore the bracket.

View solution in original post

4 REPLIES 4
vikulkar
Community Support
Community Support

hi @darkhorse12 ,

here's an approach that you can follow:
You can have a trigger when an email arrives->

then use a compose action to extract the substring from the email body->

substring(triggerOutputs()?['body/body'],indexOf(triggerOutputs()?['body/body'],'Receipt'),16)
Then have a folder created by providing the compose output on the Folder Path.
(You will have to create a dummy file in the folder as there is no 'Create a folder' action on One Drive)

vikulkar_1-1645923043738.png

 

This should create a folder with the Receipt number as its name.

Thanks and Regards,
Vikas K

Hey @vikulkar , 

 

Thank You For Suggestion, its worked, but i have also 6 or More digits numbers and then its output like this,

 

darkhorse12_0-1646030222645.png

 I don't Want ')' this bracket , I want only numbers, its that possible,  I have used split also but not getting right one

@darkhorse12 ,
In the substring function, you will have to provide the correct value for the last index.
 

vikulkar_0-1646073897487.png

If you reduce the number to 15, the function should ignore the bracket.

darkhorse12
Helper I
Helper I

Thank you for your support

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (6,345)