
Announcements
I need help! I need to create a function that solves this need.
I have a file and I need to know : If it was created in the current month in the previous month or before the previous month
Example: A file is created in 30/11/2022, a result the fuction is previous month
Hi @jurunas2023,
You could use a formatdatetime function with a MM format together with the Created property and compare it with the UtcNow function with the same MM format (after some calculation to determine the previous month). This way you can check if this is the previous month.
Below is an example
If the condition matches it will be the previous month and the flow will go to the If Yes section.
formatdatetime(item()?['Created'], 'MM')
is equal to
formatdatetime(addDays(startofMonth(utcNow()), -1), 'MM')