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!!!
@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!
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:
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.
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!!
Hi @r96359 ,
You could refer to screenshot below to create the flow:
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.
Hi @r96359, did you see this: https://docs.microsoft.com/ru-ru/power-automate/data-operations ?
Michael E. Gernaey
66
Super User 2025 Season 1
stampcoin
65
rzaneti
39
Super User 2025 Season 1