
Announcements
How can i use filter array to filter all dates coming due within next 30 days?
I tried using the below expressions but not of them are working.
Expressions
contains(item()?['Visa Expiry Date'], addDays(utcNow(), 30))
contains(item()?['Visa Expiry Date'], addDays(utcNow(), 30,'yyyy-MMM-dd'))
contains(item()?['Visa Expiry Date'], addDays(utcNow(), 30,'dd-MMM-yyyy'))
Data
Expiry Date
| 31-Mar-23 |
| 14-Feb-23 |
| 27-Feb-23 |
| 13-Sep-23 |
| 17-Oct-22 |
| 17-Oct-22 |
| 14-Nov-22 |
| 17-Oct-22 |
| 25-Jan-24 |
| 19-Jul-24 |
| 20-Jul-24 |
| 27-Feb-23 |
| 13-Oct-23 |
| 7-Mar-23 |
| 1-May-23 |
| 25-Jan-24 |
| 20-Jul-24 |
| 30-May-24 |
Hi @aurav ,
Since you will need combine two conditions together in Filter array action (later than current date AND earlier than 30 days after current date), please use the advanced mode to edit the expression:
@and(greater(addDays('1899-12-30', int(item()?['Expiry Date']), 'dd-MMM-yyyy'), formatDateTime(utcNow(), 'dd-MMM-yyyy')),lessOrEquals(addDays('1899-12-30', int(item()?['Expiry Date']), 'dd-MMM-yyyy'), addDays(utcNow(), 30, 'dd-MMM-yyyy')))
Best regards,