Hello,
In the below flow, employee folders are stored in the "/EmployeeFiles/Current" folder. When the employee leaves, their leaving date is added as metadata to their folder. This then trigger the flow and moves their folder to the "EmployeeFiles/Leavers" folder.
In the Leavers folder, we have folders for 2023 and 2024 - essentially what we want to happen is that if someone has a leaving date in the year of 2024, then their folder should move to "EmployeeFiles/Leavers/2024".
It would be useful to find out how this can be achieved.
Thanks! 🙂
@creativeopinion
I have solved this by adding in a 'Get file properties' action and a new 'Compose' action to get the Leaving Date value and use this to get the Year value - the folder is now moving to the leavers/2024 folder as required.
@creativeopinion this first bit is outputting with a true/false value rather than a date
The 'LeavingDate' column in SharePoint is a date column. So maybe the expression is wrong? empty(triggerOutputs()?['body/LeavingDate'])
@sudosaurus What this tells me is that the dynamic content you are using is outputting a boolean (true/false)—not a date.
Please confirm the output of the dynamic content you are using (in the expression) by placing the dynamic content (just the dynamic content) into its own Compose action and showing a screenshot of the output.
I believe you are selecting the incorrect dynamic content in your expression. You need to ensure that you are selecting the dynamic content for the date column. What you are selecting is the dynamic content for whether or not the date column has been changed (which returns a true/false).
For more flow troubleshooting tips—check out this YT Tutorial: 5 Power Automate Troubleshooting FAQs and Helpful Tips for Creating Better Flows
In this Power Automate tutorial, I explore 5 frequently asked questions that pop up when troubleshooting a flow. If you’d like to to level up your Power Automate flow skills and learn how to troubleshoot your Power Automate flow—this tutorial is for you!
IN THIS VIDEO:
✅ How to troubleshoot a false Condition action result
✅ How to get dynamic content when it isn’t selectable from the list of dynamic content
✅ How to troubleshoot an Apply to Each action that isn’t looping through
✅ How to troubleshoot a skipped Apply to Each action
✅ How to troubleshoot a Filter Query
✅ How to use a SharePoint yes/no column in a Filter Query
✅ How to use Compose actions to troubleshoot a Power Automate flow
✅ How to troubleshoot multiple emails being sent
✅ How to troubleshoot multiple Teams messages being sent
@sudosaurus The function is formatDateTime(). You'll need to use:
formatDateTime(outputs('Compose-LeavingDate'),'yyyy')
@creativeopinion unsure if I've done something incorrect here:
I also tried:
@sudosaurus Use the formatDateTime() function to get the year from your date column.
I'm just using a Compose action to store a date in my case, so that's what I'm referencing in the expression. Use the 'yyyy' datetime format pattern.
Append the output from the Compose action storing the year into the Destination folder field. Note: The cursor in Power Automate jumps around when you do this, it may delete the forward slash in front of the dynamic content, which you'll need to add back in.
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1