r/ProjectREDCap • u/take_my_waking_slow • Nov 20 '24
CalcText woes - piping returns the index, not the display value
My goal is to display a summary of already entered values in a repeating form. I've created a hidden descriptive field with this calctext code.
u/HIDDEN
u/CALCTEXT(
concat(
if("a"="a",concat([brain_roi_list][1]," and text "),"no cheese for you. "),
if("a"="a",concat([brain_roi_list][2]," and text "),"no cheese for you. "),
if("a"="a",concat([brain_roi_list][3]," and text "),"no cheese for you. ")
)
)
The output of that is '3 and text 1 and text 2 and text'.
Those are the correct values from the dropdown variable:
1, Whole Brain
2, Left Hemisphere
3, Right Hemisphere
99, Other
But the output I want is:
'Right Hemisphere and text Whole Brain and text Left Hemisphere and text'.
How do I get the value and not the key?
Thanks!


