In This Section

Contact
E-mail
redcap [at] chop.edu
Related Topics

Action Tag Spotlight: Word & Character Limits

Published on January 23, 2023 · Last updated 9 months ago
AddtoAny
Share:

WATCH THIS PAGE

Subscribe to be notified of changes or updates to this page.

4 + 7 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

Word and character limits can be incredibly useful and add an extra layer of control over your data in REDCap. Perhaps your project contains an essay prompt that has a word limit, or you want text responses to be within a certain number of characters. Both situations are easy to enforce in REDCap using the @WORDLIMIT and @CHARLIMIT action tags.

@WORDLIMIT

Suppose that I want survey respondents to write a summary about their experience working with REDCap with a limit of 150 words. I could just write “Word Limit: 150” in the field label or field note and trust that respondents will adhere to the limit on their own. But respondents may deviate from this limit accidentally, or they may not even notice the limit at all!

Using @WORDLIMIT, I can set the limit equal to 150 in the Action Tags/Field Annotation box.

Now, REDCap will enforce a word limit on responses, so survey respondents cannot go over the limit. In addition, REDCap will display the number of words remaining on the bottom of the field.

@CHARLIMIT

Using @CHARLIMIT to enforce a limit on individual characters is just as easy as implementing @WORDLIMIT in your project. Set @CHARLIMIT equal to the maximum number of characters you want in responses. REDCap will enforce this limit and display the number of characters remaining to survey respondents.

Note that you cannot use both the @WORDLIMIT and @CHARLIMIT action tags at the same time, so you will want to pick one or the other when designing your field.

In addition, both the @WORDLIMIT and @CHARLIMIT action tags will not be enforced on API imports. If you are planning to use REDCap’s API to import data into these fields, you will want to enforce these limits outside of REDCap before importing.

Bonus Tip: Use the @CHARLIMIT action tag in conjunction with the @PASSWORDMASK action tag to create a password-like field in your survey.