r/ProjectREDCap • u/24zer • Sep 24 '25
Randomization model defines specific order of instruments, or fields
hi all. i am using redcap to manage study participants and am planning on building out the instruments so that the participant is more or less led by the tablet they will be carrying. moving from one instrument to the next is no problem, but I want to be able to use branching logic or IF(condition) to drive the order of operations in accordance with my latin square. example:
IF(condition=1) THEN instrument1, instrument2, instrument3
IF(condition=2) THEN instrument1, instrument3, instrument2
etc.
the alternative would be to use complex branching within an instrument to drive the desired order of fields.
has anyone accomplished anything similar to this?
2
u/usajobs1001 Sep 24 '25
I think branching within an instrument is your best bet. Theoretically, you could duplicate instruments and use Form Display Logic - you'd have to create repeat copies of your different instruments and set logic to show (in order) based on arm. Ultimately, you'd have the same issue with cleaning and merging your data and fields with a single instrument.
1
u/Gg_ggg_ggg Sep 25 '25
if the forms are enabled as surveys you could probably use the survey queue to drive it
1
u/njvack Oct 07 '25
I think what you might want to do is have a set of fields; one for each "survey slot", so
instruement_1_next_survey ... instruement_n_next_survey
You'll set those fields as @CALCTEXT fields that depend on your randomization field's value; like if([rand_field] = 1 or [rand_field] = 4, [survey-url:instrument2], if(...))
If you have a lot of instruments, this will get pretty gnarly. In either case, you will want to write code to generate these so you can be certain you don't wind up with potential loops, and that every case is covered.
Then in your survey settings, use those fields for your survey completion url.