randomization in REDCap - Social Distancing Task

27 views
Skip to first unread message

Anne Morris

unread,
Feb 26, 2026, 3:36:24 PM (11 days ago) Feb 26
to Redcap Open
Hi Folks,

I'm trying to determine if there is a way to replicate functionality seen in Qualtrics, but using REDCap.  This task requires a person type in 6 first names of individuals of varying closeness to the individual (i.e. person 1 = closest relationship; person 6=like a stranger).

Then the individual is presented with follow up items that pipe in names randomly.

Can this be done using REDCap? I've done some searching already and played with trying to get this to work, but haven't been successful so I am turning to this group.

Thanks for any help!
Anne

**************************************************************************

Anne-Taylor Morris
CARA Core - Project Coordinator
VCU OVPRI - Mid-Atlantic Twin Registry ~ Spit for Science Registry
Box 980617
Richmond VA 23298

Phone: (804) 828-8112

Brad Trumpower

unread,
Mar 2, 2026, 10:04:17 AM (7 days ago) Mar 2
to Redcap Open
How complicated do you need it to be? How many names per page? Can the names repeat? 

Brad Trumpower

unread,
Mar 2, 2026, 10:20:41 AM (7 days ago) Mar 2
to Redcap Open
I'll paste the CSV of the data dictionary here. it should be a good start to solving your problem. Paste this into a text file and save it as a CSV and upload to test it in your local REDCap. It uses the current time to generate a "random" number.


Variable / Field Name,Form Name,Section Header,Field Type,Field Label,"Choices, Calculations, OR Slider Labels",Field Note,Text Validation Type OR Show Slider Number,Text Validation Min,Text Validation Max,Identifier?,Branching Logic (Show field only if...),Required Field?,Custom Alignment,Question Number (surveys only),Matrix Group Name,Matrix Ranking?,Field Annotation
record_id,admin_center,,text,"<div class=""rich-text-field-label""><p>Record ID</p></div>",,,,,,,,,,,,,
name_1,random_feeder,,text,Enter a name,,,,,,,,,,,,,
name_2,random_feeder,,text,Enter a name,,,,,,,,,,,,,
name_3,random_feeder,,text,Enter a name,,,,,,,,,,,,,
name_4,random_feeder,,text,Enter a name,,,,,,,,,,,,,
name_5,random_feeder,,text,Enter a name,,,,,,,,,,,,,
name_6,random_feeder,,text,Enter a name,,,,,,,,,,,,,
current_time,random_test,,text,,,,,,,,,,,,,, @NOW @HIDDEN
rand_num,random_test,,calc,Calculate random name,"mod(datediff(""2020-01-01 00:00:00"", [current_time], ""s"", ""ymd"", true), 6) + 1",,,,,,,,,,,,
random_name,random_test,,text,Random name generator,,,,,,,,,,,,," @CALCTEXT(if([rand_num]=1, [name_1], if([rand_num]=2, [name_2], if([rand_num]=3, [name_3], if([rand_num]=4, [name_4], if([rand_num]=5, [name_5], [name_6]))))))

@HIDDEN"
output,random_test,,text,The chosen one is [random_name],,,,,,,,,,,,,
Reply all
Reply to author
Forward
0 new messages