This function will help you to update the high custom variables for the respondents while they are answering the survey.
$survey.updateHighCustomVariable("Custom Variable Index", "Value")
Here the value for "Custom Variable Index" ranges from 6 to 255 (Custom6 to Custom255).
Consider a scenario where you want to ask respondents which Restaurant they like to go for dinner and subsequently you wish to ask them questions related to the Restaurant of their choice.
## store the response to custom 6 and redirect to Q2 ##
$survey.updateHighCustomVariable(6,"${Q1_1}")
$survey.branchTo("Q2")