cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
r96359
Helper IV
Helper IV

When Email Subject contains a keyword (one of 25), then store a string variable that can be used to define folder of same name to store attachments

Pulling my hair out trying to figure this one out.

I have emails coming in that I need to store attachments to specific folders if the subject of the email matches a keyword.

 

Process:

1. Look for specific keywords in Subject of email using contains.

2. If a keyword is a match (25 different possible keywords), then store that keyword as a variable

3. Use the variable to define the directory path the attachment will be saved in. (I have 25 different folders)

 

Example:

1. If Subject of email contains keyword 'RB75'

2. Save variable value as 'RB75' 

3. Use variable value to define path to store attachments i.e. C:\RB75\

 

I'm new to Power Automate and having a hard time figuring out how to create a array to look for contains keyword in the Subject then store that as a variable that I can use later.

 

Any help would be greatly appreciated!!!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-alzhan-msft
Community Support
Community Support

Hi @r96359 ,

 

You could refer to screenshot below to create the flow:

2.png

1.png

 

You could save the attachment to your sharepoint library or local path refer to the example screenshot.

 

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
VictorIvanidze
Community Champion
Community Champion

Hi @r96359, did you see this: https://docs.microsoft.com/ru-ru/power-automate/data-operations ?

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.
v-alzhan-msft
Community Support
Community Support

Hi @r96359 ,

 

You could refer to screenshot below to create the flow:

2.png

1.png

 

You could save the attachment to your sharepoint library or local path refer to the example screenshot.

 

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

r96359
Helper IV
Helper IV

Thank you both @VictorIvanidze and @v-alzhan-msft .

Trying to build upon this and also make the keywords easier to maintain, I created a excel file with a table called CC in SharePoint.

I think I am close.

I then used a filter array so I could use contains from the subject heading and find a match.

The output upon testing shows the result is "CompanyCodes":  "US63" . This is a match and a single result returned.

When trying to use the result as an output, the expression conc() seems to not see the filter array object. I have tried several ways and it seems to only work with strings. 

 

Any suggestions on how to fix this last step?

Images below.

 

Many Thanks!!

 

help1.pnghelp2.pnghelp3.png

 

 

 

 

Hi @r96359 ,

 

Don't know the details of the concat() expression in your flow, and you could refer to the screenshot below to create the flow:

1.png

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-alzhan-msft this idea moved me into creating a table in excel using filter array.

I then use the expression  first(body('Filter_array'))?['CompanyCodes'] to assign the value as a directory path.

 

Many thanks!

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.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

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.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,709)