How do I use quotation marks in REDCap conditional logic?
A brief overview of proper quotation mark usage in REDCap conditional logic
Which Quotes To Use:
Both single and double quotes will work within REDCap conditional logic. Since single quotes are utilized when using the Drag-N-Drop Logic Builder, it may be considered best to practice to use single quotes to ensure your syntax would be consistent whether you use the Logic Builder or Advanced Branching Logic Syntax, but ultimately it is a matter of preference.
When to use quotes:
Quotes are used to indicate an actual Field Choice from a field with coded options. For example: ‘1’ for Yes or ‘0’ for No in a Yes - No field. However, when you are using logic to indicate a value (ex. the value derived from a calculated field, the value entered in a text field collecting numbers, etc.) no quotes are needed.
Likewise, in a scenario where datediff is being calculated, you are looking for a number of days, rather than an exact Field Choice value, so no quotes are needed.
Example: datediff([surgery_date], 'today','d', true) = 6
NOTE: Be careful when copying/pasting logic from other sources as other applications may use a font which may not register correctly in REDCap.
Please see Contact Us for our support.