Hi,
I am sorry I do not quite understand what you are doing with this sentence
Each month the file will only change the unnamed month, so the flow should select files based on the current month
1. I think you mean, each month, you reason a file, and that file will not have the Month name in it????
2. I am also not sure I understand, you say it's a file, but you have 3 files in your example, so are multiple People, submitting files all for "Current Month"??? and you want to automatically rename them to add the month in the name and then email it to people?
Lastly, you said you have it scheduled, but you said
I would like the stream to trigger automatically whenever a new file is placed in the specific OneDrive folder
1. Trigger what stream the flow? So you do not want the flow to be scheduled you want it to run each time a file appears?
2. Are these files bigger than 50megs?? If so the trigger will not trigger, just an FYI.
3. Is this your personal one drive, or One drive for business
Can you please clarify what you are doing?
Here, however is a guess at what you want.
1. Use the trigger When a File is created
2. Create an Array, which you will be used to capture the File Names and File Contents that is returned by the Trigger
3. Use Apply to each to iterate through each file returned
EVERYTHING ELSE IS INSIDE the Apply to each EXCEPT the Email, depending on the answer below
---Based on the maxFileCount property it may return back 1-Many files
4. Use the Get File Contents, to get the file contents and add it to the Array, but also give it the name you want (adding the month part)
5. Use Create File, leveraging the data in the, in a different FOLDER, or else you will simply trigger the flow again.
6. Question/Clarification: I don't know if you want to send 1 email per file, or 1 email with all the files, so you would need to
--If just 1 file per email, set the maxFileCount to 1, and in the Flow remove step 2 (the array) as you wont need it.
--Instead just Grab the File Contents and Name within the Apply to each and attach that content directly in the Attachment property
--and send.
This means if you have 6 Files returned, you would send 6 files
if you want to send all 6 at the same time, put the array back
And attach them all to the Email OUTSIDE of the Apply to each, and send them.
The above steps are what you would do for 1 or many. Just remember, if you make a copy of the file with a new name,
do not use the same folder, or you will Infinity trigger the Trigger