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 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. For example: ‘1’ for Yes or ‘0’ for No. However, when you are using logic which contains greater or less than < or > specific values, you are looking for a value higher or lower than a value rather than an actual value, so no quotes are needed.

Example: [Field_1] > 0


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 that using quotes in [Field_1] > ‘0’ where a specific value is not specified, the logic may no longer work correctly in REDCap versions greater than 10.0. The exception being if you were looking for a response which was not null, you would you would obviously have to use quotes to indicate no response.

Example: [field_1] <> “”

As an aside, be careful when copying/pasting logic from other sources as other applications may use a font which may not register correctly in REDCap.

More information on using Conditional Logic can be found on the Help & FAQ page in REDCap


For additional assistance, please contact the REDCap Support Team