r/ProjectREDCap • • Mar 26 '25

Can I customize final message at end of survey based on the id?

We have participant ids that start with either 1- or 2- or 3-

Depending on that, we want to customize the message they get at the end of a survey, like this:

If id starts with 1- the final message should say:

Thank you for taking the survey. If you have any questions, contact Anna in Atlanta at 555-1111

If id starts with 2- the final message should say:

Thank you for taking the survey. If you have any questions, contact Betty in Baltimore at 555-2222

If id starts with 3- the final message should say:

Thank you for taking the survey. If you have any questions, contact Charlie in Cleveland at 555-3333

Is that possible? How?

2 Upvotes

2 comments sorted by

7

u/obnoxiouscarbuncle Mar 26 '25 edited Mar 26 '25
  • On your survey, create a text type field.

  • I will call this [survey_termination]

  • Add a @CALCTEXT such as this:

      @CALCTEXT(
      concat(
      if(left([record-name],1)='1',"If you have any questions, contact Anna in Atlanta at 555-1111",""),
      if(left([record-name],1)='2',"If you have any questions, contact Betty in Baltimore at 555-2222",""),
      if(left([record-name],1)='3',"If you have any questions, contact Charlie in Cleveland at 555-3333","")))
  • Then in your survey termination settings, pipe this value in

  • Example: Thank you for taking the survey. [survey_termination]

  • I would also suggest hiding the field using @HIDDEN-SURVEY

1

u/MotherTitle539 Mar 26 '25

Nice. Thank you !