cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Diego
Regular Visitor

AddMinutes

Hi there

 

I cant't get the following expression to work:

 

@less(utcNow('yyyy-MM-ddThh:mm:ss'), formatDateTime(addMinutes(item()?['Created'], 0), 'yyyy-MM-ddThh:mm:ss'))

 

Any idea?

 

Best Regards

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Mabel

 

Thank you very much for the fast reply. I knew the function you sent me with addDays. For testing purposes I wanted to use addMinutes. I got this figured out now:

 

@less(formatDateTime(addMinutes(item()?['Created'], 1),'yyyyMMddHHmmssffff'),utcNow('yyyyMMddHHmmssffff'))

 

Here for the community my flow to delete old files. Special in this flow is that I don't want to delete folders, otherwise younger files may be deleted along with an old folder.

 

To do this I added the following filter query to the "Get Files (properties only)" action:

ContentType eq 'Document'

 

Here the screenshot of my small flow

 

DeleteOldFiles.jpg

 

Best Regards

Diego

View solution in original post

2 REPLIES 2
v-yamao-msft
Community Support
Community Support

Hi @Diego,

 

I assume that you want to check if an item is created several days before utcNow.

 

So I create a simple flow for testing with the following function. The code I am using is:

@less(formatDateTime(items('Apply_to_each')?['Created'],'yyyy-MM-dd'), adddays(utcnow('yyyy-MM-dd'),-3))

 

When the flow is triggered, items that are created 3 days before will be got and notifications will be sent. Please check the following screenshot:

1.PNG

 

Please feel free reply if you need more help. 

 

More details about the function:

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

 

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Mabel

 

Thank you very much for the fast reply. I knew the function you sent me with addDays. For testing purposes I wanted to use addMinutes. I got this figured out now:

 

@less(formatDateTime(addMinutes(item()?['Created'], 1),'yyyyMMddHHmmssffff'),utcNow('yyyyMMddHHmmssffff'))

 

Here for the community my flow to delete old files. Special in this flow is that I don't want to delete folders, otherwise younger files may be deleted along with an old folder.

 

To do this I added the following filter query to the "Get Files (properties only)" action:

ContentType eq 'Document'

 

Here the screenshot of my small flow

 

DeleteOldFiles.jpg

 

Best Regards

Diego

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,789)