Hi there,
I have created a document library and want to automate an email to the file owner (specified in a column) before its next review date. For example: I have manually assigned the owner of the file "Document" as Joe Bloggs. Before its next review date I would like it to send an email to him so he is aware it needs to be updated. This needs to work automatically for all files within the document library.
Similar to the "Get an email reminder" template but emailing the owner instead of me.
Any help would be greatly appreciated.
Thinking about your error message a bit more, I think I know what issue you may be having with saving the flow when switching it to using Get files (properties only). What expression are you using in your condition below this action? My guess is that you used the same expression I originally posted. If so, you need to update it to the name of the Get files action.
length(outputs('Get_files_(properties_only)')?['body/value'])
Yes, you would use the Get files action for a document library. Your filter query looks correct and is using the ISO date format which is correct. However, I am not sure what the error message you are getting means. This is the right path, so maybe someone else will know what the error message means.
Hi David,
Thanks for getting to me I really appreciate your time. I have tried the above but don't believe it will work as I am using a Document Library rather than a list.
I am assuming I need to be using Get Files (Properties Only) instead? I am at the below currently.
Two issues:
1. When testing just the Get Files Flow " The expression "Next_x0020_Review_x0020_Date ge '2023-07-10' and Next_x0020_Review_x0020_Date It ' 2023-07-11'" is not valid. Creating query failed.
clientRequestId: 9ea2b8bf-0d41-4539-b4d7-93c9fb756a8a
serviceRequestId: 9ea2b8bf-0d41-4539-b4d7-93c9fb756a8a "
2. When adding the conditions expression " Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The action(s) 'Get_items_End_Date' referenced by 'inputs' in action 'Condition' are not defined in the template.'.'. "
Apologies I am a novice.
This is not too difficult. Create a scheduled workflow that runs every day. Use the Get items action with a filter query to get the items based on the Next Review Date field. For example, I have a process where I need to send an e-mail 28 days before an End Date. The filter query is:
The first expression in the filter is:
addDays(startOfDay(utcNow()),28,'yyyy-MM-dd')
And the second expression is:
addDays(startOfDay(utcNow()),29,'yyyy-MM-dd')
This will get everything in the list where the end date is in 28 days.
You will then want to add a condition to make sure items were returned so the flow doesn't fail:
The expression used in the condition is:
length(outputs('Get_items_End_Date')?['body/value'])
If items are found for that day, use an Apply to each to send the e-mail to each document owner.