Discuss

Database Single Query

On this page

You can create a database query which returns a single record. That's really useful in cases where you filter your data and expect a single result to be returned, like retrieving the logged in user info - so no complicated repeats are required.


In this tutorial we will show you how to filter a Single Query and use the result directly in the rest of the Server Action steps. We created a server action, which is going to be used for retrieving the logged user details, so we already added the standard database connection and security provider steps:

Screenshot_1|690x418

Right click the Security Provider step, open Database Actions and select Database Single query:

Screenshot_2|690x418

Configuring the Database Single Query is identical to configuring a regular database query. Just click Query Builder:

Screenshot_3|690x418

Add the table you want to query and then add the columns you need:

Screenshot_4|690x418

Setup your filters. In our case we filter the user ID by the Identity returned by the Security Provider step:

Screenshot_5|690x418

Click OK when you are done. You can access the Single Query results in any Server Connect step, added after it. In the following example, we have a send mail step and we can directly bind the query results in the mail body:

Screenshot_6|690x418

Click the Dynamic Data Picker button:

Screenshot_7|690x418

And you will see the Single Query bindings available in the picker:

Screenshot_8|690x418

You can use them wherever you need them, without using any repeaters as the Single Query only returns a single record.