Hi,
I am trying to make a flow that copy an item from one SharePoint list to another if the item is more than 10 days old. This is done for archiving reasons.
As specified in the pics below i use "Select" to get the outfor for however days has past since the item was created. I then make an apply to each with a condition that says length('Days since creation') is greater than 10.
I think that "lenght" should get me the output from the "Select" action. I have a hard time figuring out what it is actually comparring. Since the outcome seems somewhat random.
How do i get i to look at the outputs individually and based on that only copy those who are true in terms of the conditions?
Select action specified:
Condition specified:
Solved! Go to Solution.
Hi @Anonymous,
Do you want to get items from a list that were created 10 days ago? Do you have a column for Created Date in the list?
I have made the following test on my side. There is a Date column for the created date in the list, it is formatted as Date only.
In the Get items action, use the following code in the Filter query field:
Date le formatDateTime(addDays(utcNow(),-10),'yyyy-MM-dd')
Note: Make sure the formatdDateTime function is surrounded by a single quote.
Then under the action Apply to each, add the action Create item, fill the filed with corresponding dynamic contents.
Please take the following doc on Filter query and WDL for more details:
https://docs.microsoft.com/en-us/previous-versions/dynamicsnav-2016/hh169248(v=nav.90)
https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language
Best regards,
Mabel Mao
Hi @Anonymous,
Do you want to get items from a list that were created 10 days ago? Do you have a column for Created Date in the list?
I have made the following test on my side. There is a Date column for the created date in the list, it is formatted as Date only.
In the Get items action, use the following code in the Filter query field:
Date le formatDateTime(addDays(utcNow(),-10),'yyyy-MM-dd')
Note: Make sure the formatdDateTime function is surrounded by a single quote.
Then under the action Apply to each, add the action Create item, fill the filed with corresponding dynamic contents.
Please take the following doc on Filter query and WDL for more details:
https://docs.microsoft.com/en-us/previous-versions/dynamicsnav-2016/hh169248(v=nav.90)
https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language
Best regards,
Mabel Mao
Yes, I wanted to get those items that was more than 10 days old and move those to another list.
Additionally, I want to delete them from the old list, but I guess that is just inserting a "Delete item" into the apply to each and then choose the Id from the "Create item" action.
The flow you have described workes perfect and I found out that by changing the "Date" in the string to "Created" I can make it look at the created column which SharePoint creates by itself.
Thanks 🙂