How to fetch list of published webforms from webform module? How can I fetch list of published webforms from webform module?

I want to show all published webforms in dropdown to the user, so user can select one of the available forms.

Cheers
-Zafar
In Drupal 7 it would be something like:

$nodes = node_load_multiple(array(), array(
  'type' =&gt; 'webform',
  'status' =&gt; 1,
));


Have a look at the docs for node_load_multiple. You could (and probably should) also use EntityFieldQuery as mentioned in the docs. The given examples assumes that you use the default webform content type.

You could then use the $nodes array to build options for a Form API select element:

$webforms = array();
foreach ($nodes as $nid =&gt; $node) {
  $webforms[$nid] = check_plain($node-&gt;title);
}
$form['available_webforms'] = array(
  '#type' =&gt; 'select',
  '#title' =&gt; t('Webforms'),
  '#options =&gt; $webforms,
);