I am using Views, LDAP query, Webform Views, and Webform to try and produce a webform that -- along with a bunch of other stuff in the webform -- has a select list of names, with emails associated, from our ldap server. So far I have gotten a View page with all the names, but I don't know how to condense that to not just be a giant list (un-collapsible) in the middle of a webform. So any idea how to do this or some similar solution so that the person filling out the form can find a name in a list of names, and for either them to see the email in a list and select/write it in another field, or for them to just select a name from a select list and have that selection effect the results(like providing an email to go with the name)?

Some other info -- the LDAP data has names and emails, as well as a variety of other information that would be useful to the people reading the results. Also, I have tried using feeds, and ldap feeds and was unsuccessful, but I would be happy if there was anyway to use both of those as well.

1 Answer 1


If you have a valid ldap query with names and emails your basically there with Views and LDAP.

You want to make a custom webform component in a module using PHP code. You can use views_get_results to get the results of the LDAP view as an array.

Then just build a webform component as you would a Forms API select widget with your values.

You then tell the webform to use your component in the UI.

  • I unfortunately am not that technically savvy, because I don't know php. I was hoping for a module solution, though I will keep your answer in mind. Thanks
    – Draedalus
    Commented Jan 15, 2013 at 18:16
  • unfortunately I'm unaware of a module solution. This solution involves 3rd party modules already. But modules can't satisfy every use-case possible. That's why the APIs I mention exist, to allow you to use the modules and implement/extend their functionality to meet your needs. The LDAP views query can be built visually with ldap_views (though you still write the ldap query by hand). You just need the custom module to create your custom webform component. I've used all the modules we're talking about here.
    – tenken
    Commented Jan 15, 2013 at 18:42

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.