Hi @JohnL1212
I am making assumptions based on your format of the Subject.
Step 1. The Email triggers
Step 2. You validate its the right email, however you do it, you need to do this before you do anything else
Step 3. Parse the client name from the Subject
So pretend I have this as the subject
New Trade - Client: new Client; Date: 2019-01-01
I will create 2 Initialize Variables and set them to type string,
1. I named this ClientName and to get the client name value for it use the below expression.
a) Which will first split by the ; which you have.
b) Then it will trim off spaces on ends
c) Then it will spit again based on the string New Trade - Client:
d) And then again trim spaces.
e) This gives you the Name
trim(split(split(variables('Subject'), ';')[0], ':')[1])
Step 4. Parse the date string from the Subject
Tto get the Date I named this one DateValue
trim(split(split(variables('Subject'), ';')[1], ':')[1])
As you can see I now have those values in my variables ClientName and DateValue
Step 5. Create the top folder (assuming it doesnt exist, which you should check first but up to you)
-Add a Create new Folder (SharePoint action)
--add your site address
--add your list or library path
--use the ClientName variable for your first folder
Step 6. Create the date folder (assuming it doesnt already exist, which you should check)
-Add another Create new Folder (SharePoint action)
--add your site address
--add your list or library path
--now use this as an expression
concat(variables('ClientName'), '/', variables('DateValue'))
And now you have them created and you can save your file. Just remember when you go to save files, you must use the proper ID from the Create new Folders, to identify the folder to go to since it didnt exist before.
If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others
Cheers
Thank You
Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
https://gernaeysoftware.com
LinkedIn: https://www.linkedin.com/in/michaelgernaey