• I have 2 webforms: survey webform and task webform.
  • The entry point is task webform and it requires user to login.
  • There is a controller or something to check if user has previously filled in a survey webform, if he/she did, go straight to task webform. Otherwise, need to go to survey form.
  • I know how to create webforms, but not sure how to make such controller.

1 Answer 1


I am not sure about your control here, whether to move from survey webform to task webform or the vice versa. But this is what I would do.,

  1. On login query the "webform_submissions" table with the logged in user's id and see whether he/she has submitted the webform before.

  2. If he/she has not submitted it before load the webform say task webform.

  3. If he has submitted this before, load the survey webform page.

You can make use of "hook_user_login" to redirect on login, also this can be used to query the "webform_submissions" table.

  • hook_url_inbound_alter works for me. It allows me to match the url, then check whether a user fills a survey or not.
    – kenpeter
    Commented May 14, 2013 at 23:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.