Re: Comparison of two dates in SharePoint bibliothec
Instead of using calculated columns in your SharePoint list for this (I am assuming that is what you are doing) I would set a static certification date column and then run the flow in recurrence to only get items that are 30 days from expiration and run your actions on those:
1. Trigger: Start your flow with an appropriate trigger, such as "Recurrence" if you want the flow to run at regular intervals, or "When an item is created or modified" if you want it to trigger when a new item is added or an existing one is updated in your SharePoint list.
2. Action: Add the "Get items" action to retrieve all items from your SharePoint list that have a certification date.
3. Filter Query: after getting the items, add a "Filter array" action to filter the items based on the certification date. Use an expression like `addDays(items('Get_items')?['body/CertificationDate'], 30)
to calculate a date that is 30 days from the current date. (You could also use the filter query in the get items which would be more performant as it would only get the items you need from the list)
4. Loop: Add a "Apply to each" control and set it to loop through the filtered items.
5. Condition: Inside the loop, add a "Condition" action to check if the certification expiration date of the current item is equal to the calculated date from step 3.
6. If true, take appropriate actions (e.g., send an email, create a task, etc.) for the items that meet the criteria.