How to scheduled an event based on the attribute values ?

Hi all,          In my domain model, I have one Event entity. In which I have StartDate (DateAndTime), EndDate (DateAndTime) and Duration (Int) attributes. Employee creates the task and setting the start date and end date in this task. Based on the end date, I want to trigger an microflow which sends email to that particular user. We can use scheduled event to trigger an microflow, but we have to set the time in a static way. But I want to achieve this same functionality in dynamic way. is there any way to trigger an microflow based on the end date.[ My use case is, that send mail microflow should be called one day before of end date and giving the notification to users. Task end time is going to end like this ]. If you have any idea about my query, kindly share your ideas within the comment section. Thanks for the reply in advance.
1 answers

Hi Bharathi,

if i understood your use-case correctly – You want trigger Mail-Notification to the end-user if his/her task end-date is going expire in next day ?

If so, i suggest this way- 

    Step 1:  We can add one boolean attribute flag(Yes/No) in same entity(in your example it is Event)

   Step 2:  Create one microflow that polls this entity and do retrieve action on Event entity using XPATH (you can keep one day before Date logic here).

   Step 3:  Then for the returned records you can keep logic to trigger mail-notification(Sub microflow).

  Step 4:  Once you mail-notification has been sent, you can set the boolean flag to “Yes” for that records, so that in your    next run of the job(Step 2), you can easily filter records based on this flag(otherwise, it will apply date logic for all records and if you have huge records, then this will work in optimized way.

Thank you.!