This function will help you to update the custom variables for the respondents while they are answering the survey.
$survey.updateCustomN("Value")
Here the value for N ranges from 1 to 5 (Custom1 to Custom5).
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 1 and redirect to Q2 ##
$survey.updateCustom1("${Q1_1}")
$survey.branchTo("Q2")