As the title suggests, I would like to know what is the correct hook for retrieving datas after a submission. The goal is to do a task based on the value of a data. Any help would be appreciated.

  • 2
    The question is too broad and there are too many possible answers. You can add submit callbacks to a Webform the same way as to any FAPI form. Depending on the version you might also find webform specific hooks (D7) or plugins (D8).
    – 4uk4
    Commented Jun 26, 2019 at 19:03
  • Thanks for your reply, I am on a version 8.6.13. In fact my question is in which hook I can put my code which is to do a certain task according to the value of a data of the webform. for example, does a hook_webform_submission_submit exist?
    – Touco
    Commented Jun 26, 2019 at 19:14
  • 2
    In D8 use a submit handler plugin, see cornel.co/article/create-webform-submit-handler-drupal
    – 4uk4
    Commented Jun 26, 2019 at 19:27

1 Answer 1


You can leverage webform_get_submissions to retrieve this data.

I also believe this question has been answered earlier with example. Refer

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