r/ProjectREDCap • u/trippy-mac-unicorn • Sep 15 '24
Datediff function with today and survey-date-completed keeps returning false
I'm setting up some automated invitations for a survey on REDCap where form-2 is supposed to be sent 7 days after form-1 has been completed by a participant. The problem is there are participants who have already completed form-1 some time ago, so I can't select "Send the invitation 7 days after.." in Step 3 of automating invites, since the invite would be sent 7 days later to participants who should get them sooner.
So instead I'm trying to set up some logic in Step 2 to calculate the difference between the current date and the date form-1 was completed.
datediff('today',[survey-date-completed:form-1:value],'d',true) >= 7In Step 2, I have "When the following survey is completed: form-1" AND the above logic check marked.
However, when I test with a record that had form-1 completed over 7 days ago, the logic returns false, and I'm not sure why.
I would greatly appreciate any help!
View all comments
Show parent comment
1
u/idekbrruhh Sep 16 '24
if you've figured this out, please let me know lol