Hi, we have an option variable called lastExportDate and a field called lastModified. When we are trying to find the difference between two values using DaysDiff, we are not getting any result. Can somebody please help out with the Javascript code and the expression to use in additional data?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @Sanjana12 ,
Considering your option's Data type is 'Date+time'
In workflow, fetch the option value and store it in variable as below,
vars.lastExportDate=getOption('lastExportDate');
In Query additional data or in enrichment, add the below expression to fetch the Days difference,
DaysDiff(ToDateTime($(vars/@lastExportDate)),@lastModified )
Hi @Sanjana12,
Check that both the fields you are comparing are of the date or datetime data type. If not, the function might not give you correct results or no results at all.
BR,
Ishan
Hi @Sanjana12 ,
Considering your option's Data type is 'Date+time'
In workflow, fetch the option value and store it in variable as below,
vars.lastExportDate=getOption('lastExportDate');
In Query additional data or in enrichment, add the below expression to fetch the Days difference,
DaysDiff(ToDateTime($(vars/@lastExportDate)),@lastModified )
Is it possible to hardcode the values instead of fetching the option variable value.If so, how to do it?
Views
Replies
Total Likes
Hi @Sanjana12
Yes you can also hard code the value as :
DaysDiff(ToDateTime('29/02/2024'),@lastModified )
I would suggest you could keep the code dynamic with @ParthaSarathy suggested code.
Thanks
Akshay
Views
Likes
Replies
Views
Likes
Replies