While using a form that is exposed through the Test Data on Demand (TDOD) portal, there is at times a requirement to populate a field value (or set of values) based on the value a user has selected for another field on the same form. This article explains how to implement such functionality.
Is there a way to populate a TDOD field based on a value selected in the previous field?
For example: If "Environment" field appears first in my form, and then comes "AGENT COUNTRY":
If “QA1” is selected for the Environment field, how to display only certain values for “AGENT COUNTRY” based on the Environment value “QA1”?
TDM 3.2.2 and later
Suppose the Datamaker variable for the "Environment" field, ~env~, is defined as @aslist(@sqllist(P~DataSource~,SELECT XX from TABLE1)@)@.
This rule will provide a drop-down list of values for the "Environment" field - the values are determined by the results of the SELECT query.
You then need to define the variable used for the second field (AGENT COUNTRY in this case), based on the ~env~ variable. For example:
@aslist(@sqllist(P~DataSource~,SELECT COUNTRY FROM table2 WHERE envcolumn IN ('~env~'))@)@
More information on Datamaker functions and parameters can be found here: https://docops.ca.com/ca-test-data-manager/3-6/en/reference/datamaker-functions-and-parameters