Skip to main content

Notifications

Power Automate - Building Flows
Unanswered

Compare Email Subject and Save Attachment

Posted on 15 Nov 2024 13:05:48 by 2
Hello Team,
 
Looking for your support to build the flow which help us to compare and math the email subject and save attachment into SharePoint folder with respective folders.
 
Fo example, if we create a folder in SharePoint with name "A" and user A send email with subject "Invoice Customer A" then if email subject contains username A and save the attachment into folder "A" only. 
  • MM-15111256-0 Profile Picture
    MM-15111256-0 2 on 28 Nov 2024 at 05:16:05
    Compare Email Subject and Save Attachment
    Hi Nived,
     
    Yes, customer names like Invoice Customer A (A = John Smith) & so on. We have more around 60 customers.
  • Mark Nanneman Profile Picture
    Mark Nanneman 329 on 16 Nov 2024 at 21:15:41
    Compare Email Subject and Save Attachment
    IMO, this isn't the best way to do something like this.  You can have multiple people with the same common name, people can mispell names or even just use alternate spellings, people can get married then the name changes, etc.  You really want to have a unique key of some sort, some sort of customer id number to use.
     
    That said you can do what you're saying, you just need to use string manualation actions / expressions in your flow.

    For instance if your subject was "Invoice for Customer John Smith" something like "Trim(Last(Split(<reference to email subject string>,' Customer ')))" would output "John Smith".

    You can then list your root sharepoint folder and filter on items that are folders, and also filter on folders that have the customer name in the folder name to find the customer's folder.

    But, as I hinted before, this would not be a best practice.  Best practice would be to store the customer names in some sort of Database, even a sharepoint list, and give each one a unique id, and use that unique id in your emails.  Your SharePoint list or other database could have the path to their sharepoint folder stored in a column, and you just lookup the customer by their ID from the email, then grab their sharepoint folder path, then save the attachments to that folder.

    Hope that helps!

    If this helped you, please click "Does this answer your question" and give it a like to help others in the community (+ close the ticket)!

    Power Platform Developer | LinkedIn: Mark Nanneman | Blog: Power Stuff  | YouTube: Mark's Power Stuff  | Buy me a coffee
  • Nived_Nambiar Profile Picture
    Nived_Nambiar 16,527 on 16 Nov 2024 at 17:19:40
    Compare Email Subject and Save Attachment
    Hi,
     
    would email subject would be in format of Invoice Customer A , Invoice Customer B like that ?....
     
    Just to confirm 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,151

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,845

Leaderboard