I am trying to design a standard HR assistant which will give user an option to apply leaves. Now for this I have Date Period Entity but I am not sure how to validate this.
Need to validate that From Date should be greater than the present date.
Need to validate that To Date should be greater than the From Date.
You need to define a script node to validate the From Date to Present date. Capture the date entered by user and then validate to present date using Script Node.
I followed the same but I am not able to write script for date period entity.
Hence I modified the designer flow and added two separate date entities for from date and to date and then added a script node to validate the difference as below snap:
I followed the same but I am not able to write script for date period entity.
Hence I modified the designer flow and added two separate date entities for from date and to date and then added a script node to validate the difference as below snap:
The date period entity returns a JSON object where the from and to dates are separate values and so they can be referenced in JS: context.entities.entityName.fromDate and context.entities.entityName.toDate
Ordinarily the platform will return the earliest date in fromDate and the latest date in toDate, so you don’t have to perform that check anyway.