web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Using AI functions to ...
Power Automate
Unanswered

Using AI functions to read specific text in an email

(1) ShareShare
ReportReport
Posted on by

I am trying to make a flow that will read the job number in an email, and then action by sending the email to the appropriate OneDrive job file folder.  I cannot work out how to define it in the flow.  Any ideas?

Categories:
  • sandeepstw Profile Picture
    312 Moderator on at

    Hi There,

     

    To automatically sort emails into OneDrive job folders based on the job number from an email, follow these steps in Power Automate, use the "When a new email arrives" trigger from the Outlook connector.

    Use the "Initialize variable" action to create a variable to hold the job number. Use expressions or functions to extract the job number from the email subject or body, depending on where it's located.

    Use another "Initialize variable" action to set the path for the OneDrive folder. Typically, the path would be constructed like /Jobs/[JobNumber] where [JobNumber] is replaced by the extracted value. Use the "Get file metadata using path" action from the OneDrive for Business connector to check if a folder with the given job number already exists.

    After the above action, use a condition to check if the folder exists based on the output of the previous action. If the folder doesn't exist (in the "No" branch of the condition), use the "Create new folder" action from the OneDrive for Business connector to create the folder using the path you've defined.

    Finally, use the "Create file" action from the OneDrive for Business connector. For the file path, use the folder path you've constructed and append the email's subject (or another desired naming convention). For the file content, use the email's body or attachments as needed.

     

     

    Please give kudos and mark as solution if it helps.  

      

    Thanks, 

    Sandeep Mishra 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 423

#2
11manish Profile Picture

11manish 308 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 177

Last 30 days Overall leaderboard