Hi Srikanth,
You can handle this by matching each Status with its DueDate using the same index array, then filtering only the OPEN items.
Simple logic steps:
-
Get today's date
-
Loop through the arrays
-
If Status = OPEN, check its DueDate
-
Use DateTimeDiff to compare DueDate with today
-
Keep the date with the smallest positive difference
In Genesys Cloud, you can use DateTimeDiff like this:
- DateTimeDiff(ToDateTime(DueDate[i]), GetCurrentDateTime(), "days")
- You may need to augment the DueDate format to be compatible with the above logic, you can this within Genesys itself via updating the variables required.
This will return:
So you can ignore negative values and from the remaining ones select the smallest value. That will give you the closest upcoming OPEN due date, even across month-end or year changes.
------------------------------
Josh Coyle
Senior Professional Services Consultant
------------------------------
Original Message:
Sent: 03-04-2026 10:54
From: Srikanth k s
Subject: Only Future Dates Open Installments?
Scenario, the next installment information should play the OPEN status with the closest due date to the current date.
I am receiving the following API array variables:
Status (Array)
DueDate (Array) – date format should be yyyy-MM-dd.
I am a bit confused about how to compare the closest due date with the current date. Has anyone implemented this kind of scenario? Any ideas would be helpful.
#ArchitectandDesign
------------------------------
Srikanth k s
------------------------------