Last updated
Was this helpful?
Last updated
Was this helpful?
Thanks to the dynamic piping features you may create cascading lists that are generated dynamically based on other lists selections.
In this example we will suppose that we already have a table of companies and employees and take a list of those companies and a list of their employees to show how to link both to create a dynamic parent / child related list.
We have now to create our employee answer sql answer item that will be linked to the companies. To do that create a new answer sql type with following query
name CompanyId, value: [[CompanyId]]
If you only want to show the list when there is an actual result you can enable the Hide on empty query results which will hide the list as long as the respondent did not select any value in the company list.
There are no limits on the number of lists that can be inter-connected and you can as well connect any other ngSurvey answer type that support value piping to your list
First things first we need to a new for the companies list that will get all companies from the database and their ids.
Now that we have our company list we can this newly created answer type to any questions or our survey. Once its added open its and set its pipe alias property to : CompanyId
Add a new to your with following parameters
Next that employee SQL list answer type to any of your survey question. ngSurvey will during the survey lookup the answer having a set to CompanyId and use the value entered / chosen by the respondent as a parameter for the employee query. In our example it will retrieve all the employee of the selected company of the other sql list.