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
Resident Rockstar
Resident Rockstar

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



Freelance Power Automate developer. $50 per hour.
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

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
Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,232)