Hello everyone; I have a problem with a retrieve for an object with the yesterday date. This is my case: I need to do some calculation between two objects called “report”. When i create and save a report, a mf is triggered and i want to retrieve the object report with the yesterday date Example: i create a report on 16 April, and when i save it the microflow has to retireve the report made on 15 April and do the calculations. I have created a variable called “Yesterday” with this content addDays($Report/Date, - 1) the retrieve of the report have this xpath: range: first [Date = $Yesterday] Why the object is always empty? Thanks in advance
asked
Alessio Anghileri
4 answers
1
Hi,
As Robert Says, You have to compare date with range conditions like – Date > $yesterday and Date < $Today. Make sure you use [%beginOfCurrentDay%] for getting today’s date – this will give the date with time set to 00:00:000 else your values might point to the exact time it was created.
answered
Kamalanathan
1
And do not forget to check if your date is localized. Otherwise use the UTC versions. And you have alsothe [%EndOfCurrentDay%] and [%EndOfCurrentDayUTC%] keywords you can use. So you need to check greater or equal then the beginning of that day and smaller or equal of the end of that day.
Regards,
Ronald
answered
Ronald Catersels
0
Do you have a time element in there? If you do, it would have to match the date and time exactly.