xCP 1.x compatible
Example: the last five active users
![Forms_Builder_Adaptor_example_List](http://www.crazyapple.de/wordpress/wp-content/uploads/2012/08/Forms_Builder_Adaptor_example_List.png)
First you must create a global or template adaptor. Use the data source adaptor to create a DQL or SQL – Query and include dynamical information from external data source.
The following query returns the last logged in users
select user_name, last_login_utc_time from dm_user WHERE user_os_name not like 'dm%' AND user_name = SUBSTR( default_folder,2,20)ORDER BY last_login_utc_time DESC ENABLE(RETURN_TOP 5)
ReadOnlyTable
Make sure that you are working in the “Design view” and insert a ReadOnlyTable. The table has a lot of properties, please label the table and select the “Special” tab.
Select your individual adaptor as external data source.
![Forms_Builder_Adaptor_4](http://www.crazyapple.de/wordpress/wp-content/uploads/2012/08/Forms_Builder_Adaptor_4-300x103.png)
Remember: the output data was created as an indivudual complex type. The output type called “data” and the group named “item”. The individual items are the result values of the query: user_name and last_login_utc_time.
The output data is sortable. You can relabel the columns and set the visibility and the width of the rows.
ListBox
![Forms_Builder_Adaptor_4_List](http://www.crazyapple.de/wordpress/wp-content/uploads/2012/08/Forms_Builder_Adaptor_4_List-300x117.png)
The ListBox functionality is very similar to the ReadOnlyTable. The adaptor must be specified for every individual ListBox in the “Data & Storage” tab.
The login-time as unique value is not recommend, because it is not an identifier. The query should be extended with one unique id, for example the r_object_id.
In the ListBox only one value is available. Please select one of the result values of the query.
![Forms_Builder_Adaptor_4_List_data_binding](http://www.crazyapple.de/wordpress/wp-content/uploads/2012/08/Forms_Builder_Adaptor_4_List_data_binding-300x115.png)