# Populate a Prompt For Variables Sorted List from a SQL query

**URL:** https://www.finalbuilder.com/forums/t/populate-a-prompt-for-variables-sorted-list-from-a-sql-query/463
**Category:** Discussion
**Created:** [May 10, 2007, 5:07am UTC](https://www.finalbuilder.com/forums/t/populate-a-prompt-for-variables-sorted-list-from-a-sql-query/463 "2007-05-10T05:07:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [May 10, 2007, 5:07am UTC](https://www.finalbuilder.com/forums/t/populate-a-prompt-for-variables-sorted-list-from-a-sql-query/463/1 "2007-05-10T05:07:00Z")

</div>

I need to pick from a list of servers to&nbsp;deploy to, referenced by name and int ID.&nbsp; How can I load this list into a dropdown or checklist for picking and iteration of the selections?

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [May 10, 2007, 6:14am UTC](https://www.finalbuilder.com/forums/t/populate-a-prompt-for-variables-sorted-list-from-a-sql-query/463/2 "2007-05-10T06:14:30Z")

</div>

My suggestion would be to use an ADO Dataset Iterator and then a Prompt for Variables (enhanced). Any other suggestions?

---

<div class="post-metadata">

### Author: ![stevage](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/bc8723/32.png) [@stevage](https://www.finalbuilder.com/forums/u/stevage)
#### Post date: [May 10, 2007, 6:14am UTC](https://www.finalbuilder.com/forums/t/populate-a-prompt-for-variables-sorted-list-from-a-sql-query/463/3 "2007-05-10T06:14:34Z")

</div>

I’ve done this a few times.   
1) Use the iterator to populate a variable like %servers% with a value separated by newlines: "SERVERCODE1 - Description of server1[NL]SERVERCODE2 - Description of server2…[NL]"  
2) Use a “check list” type field with %servers% as the “Values” field.  
3) Iterate through the resulting variable, trimming the select result from something like “SERVERCODE1 - Description of server1” to just “SERVERCODE1”.  
  
Steve  
EDIT: forum software strips out anything resembling an HTML tag. And it does it badly ☹
