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?

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?
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