Custom action on the "Next Stage" button

I want the “Continue” or “Next” button to navigate the user to different stage but on different output. For example,

  • if the user selects option a, clicking on the continue will navigate to stage 3
  • if the user selects option b, continue button will navigate to stage 4
  • if the user has selected both option a and option b, the continue button navigates the user to stage 5