Aug 06 2016 09:14 PM
I am trying to create a recurring Flow which checks the difference between a date field [ContractEndDate] and variation from todays date.
If ContractEndDate is less than (todays date + 15 days)
Looking at the workflow definition language here (https://msdn.microsoft.com/library/azure/mt643789.aspx) i came up with the following logic:
@less(item()['ContractEndDate'], adddays(utcnow('yyyy-mm-dd'),15)
If I remove the 'adddays' function, it works.
Any ideas?
Aug 07 2016 11:44 PM
SolutionThe adddays function returns a string (iso date format), but the first part of your less function contains a date format that has not been formatted yet, so I suspect that the string compare does not give a proper result.
You should format the ContractEndDate to the same string format as the calculated date to have the Less function work as expected.
Aug 08 2016 12:50 AM
Thanks @Mike Platvoet. That worked!!
I converted the date into string as follows:
less(string(item()['ContractEndDate']), adddays(utcnow(), 15))
Aug 08 2016 12:56 AM
Jan 25 2018 09:14 AM
Hi,
I am using the SQL Server Get line action and would like to compare the date of creation of a line in a table (field CREDAT_0) with the current date and be able to send an email when the creation date is today.
I have tried to convert the utcnow to the exact same format as my sql date but my flow keeps failing (no need to mention I have tried it without the condition and it works, that is to say it retrieves all the lines in the table).
Here is the sql date format and the condition I have put in place.
Thanks in advance for your kind help
addDays(utcnow('yyyy-MM-dd HHmm:ss.fff',0, 'yyyy-MM-dd HHmm:ss.fff'))"
Mar 01 2018 07:02 AM
Hi Dear
I am writing the following to a SharePoint column but it is not getting successful, the condition is not going to YES.
@equals(string(item()['Contract_x0020_End_x0020_Date']), adddays(utcNow(), 20))
if you can guide, where is the mistake thanks in Advance
Mar 01 2018 08:30 AM
Aug 07 2018 10:37 AM
utcnow() has a time in it as well as the date. your contract end date likely includes a time as well, so adding 20 days will still result in a false unless the time of the contract end date and the utcNow() current time happen to be exactly the same (not impossible but very unlikely).
try using the startofday() function along with what you have. that should keep any difference in time from causing a problem.