Hello,
I hope you can help me. How can I filter information in the application? For example I have the Variable State which is a radio button with values
Guatemala 1
Suchitepequez 2
Sololá 3
And I have another Variable Site which is also a radio button with Values
Palencia 1
San Juan Bautista 2
Sololá 3
Panajachel 4
What I want to do is when I choose for example in the first radio button answers 1(Guatemala) , in question 2 I want to see only the Sites that belong to that selected department .
Is it possible to do that?
Thanks, aprreciate your help
Dynamic
Re: Dynamic
Hi,
That is possible with the DYNAMIC VALUESET options. You can read up in the help or check out an example from this document posted by Josh sometime back on this platform: http://teleyah.com/cspro/DCJune2015/04-CAPI/04-CAPI.pdf
That is possible with the DYNAMIC VALUESET options. You can read up in the help or check out an example from this document posted by Josh sometime back on this platform: http://teleyah.com/cspro/DCJune2015/04-CAPI/04-CAPI.pdf
Re: Dynamic
Hi efmf93,
I have done something similar with departamentos and municipios.
And It goes as follows:
Hope could help you in some way.
The only thing I don´t know is if we can still use the code " set attributes(MY_FIELD) assisted on (responses); " on the latest versions.
Maybe Josh and Greg could help us to clarify this.
Regards.
I have done something similar with departamentos and municipios.
And It goes as follows:
Code: Select all
PROC C1_COD_MUNICIPIO
preproc
if C1_COD_DEPTO = "01" then
setvalueset(C1_COD_MUNICIPIO, C1_COD_MUNICIPIO_VS1);
elseif C1_COD_DEPTO = "02" then
setvalueset(C1_COD_MUNICIPIO, C1_COD_MUNICIPIO_VS2);
elseif C1_COD_DEPTO = "03" then
setvalueset(C1_COD_MUNICIPIO, C1_COD_MUNICIPIO_VS3);
elseif C1_COD_DEPTO = "04" then
setvalueset(C1_COD_MUNICIPIO, C1_COD_MUNICIPIO_VS4);
elseif C1_COD_DEPTO = "05" then
setvalueset(C1_COD_MUNICIPIO, C1_COD_MUNICIPIO_VS5);
elseif C1_COD_DEPTO = "06" then
setvalueset(C1_COD_MUNICIPIO, C1_COD_MUNICIPIO_VS6);
elseif C1_COD_DEPTO = "07" then
setvalueset(C1_COD_MUNICIPIO, C1_COD_MUNICIPIO_VS7);
elseif C1_COD_DEPTO = "08" then
setvalueset(C1_COD_MUNICIPIO, C1_COD_MUNICIPIO_VS8);
elseif C1_COD_DEPTO = "09" then
setvalueset(C1_COD_MUNICIPIO, C1_COD_MUNICIPIO_VS9);
elseif C1_COD_DEPTO = "10" then
setvalueset(C1_COD_MUNICIPIO, C1_COD_MUNICIPIO_VS10);
elseif C1_COD_DEPTO = "11" then
setvalueset(C1_COD_MUNICIPIO, C1_COD_MUNICIPIO_VS11);
elseif C1_COD_DEPTO = "12" then
setvalueset(C1_COD_MUNICIPIO, C1_COD_MUNICIPIO_VS12);
elseif C1_COD_DEPTO = "13" then
setvalueset(C1_COD_MUNICIPIO, C1_COD_MUNICIPIO_VS13);
elseif C1_COD_DEPTO = "14" then
setvalueset(C1_COD_MUNICIPIO, C1_COD_MUNICIPIO_VS14);
elseif C1_COD_DEPTO = "15" then
setvalueset(C1_COD_MUNICIPIO, C1_COD_MUNICIPIO_VS15);
elseif C1_COD_DEPTO = "16" then
setvalueset(C1_COD_MUNICIPIO, C1_COD_MUNICIPIO_VS16);
elseif C1_COD_DEPTO = "17" then
setvalueset(C1_COD_MUNICIPIO, C1_COD_MUNICIPIO_VS17);
elseif C1_COD_DEPTO = "18" then
setvalueset(C1_COD_MUNICIPIO, C1_COD_MUNICIPIO_VS18);
elseif C1_COD_DEPTO = "19" then
setvalueset(C1_COD_MUNICIPIO, C1_COD_MUNICIPIO_VS19);
elseif C1_COD_DEPTO = "20" then
setvalueset(C1_COD_MUNICIPIO, C1_COD_MUNICIPIO_VS20);
elseif C1_COD_DEPTO = "21" then
setvalueset(C1_COD_MUNICIPIO, C1_COD_MUNICIPIO_VS21);
elseif C1_COD_DEPTO = "22" then
setvalueset(C1_COD_MUNICIPIO, C1_COD_MUNICIPIO_VS22);
endif;
set attributes(C1_COD_MUNICIPIO) assisted on (responses);
The only thing I don´t know is if we can still use the code " set attributes(MY_FIELD) assisted on (responses); " on the latest versions.
Maybe Josh and Greg could help us to clarify this.
Regards.
Re: Dynamic
The "set attributes(MY_FIELD) assisted on (responses)" is no longer needed in recent (6.2 and later) versions of CSPro. Instead just the set capture type of the field on the form to be "radio button".
The approach that jfigueroa uses will work well if you have a small number of options. If you have more it may be easier to use a lookup file. For an explanation take a look at page five of this document:
http://teleyah.com/cspro/SouthAfricaOct ... aEntry.pdf
It's titled "Dynamic Value Set from a Lookup File."
The approach that jfigueroa uses will work well if you have a small number of options. If you have more it may be easier to use a lookup file. For an explanation take a look at page five of this document:
http://teleyah.com/cspro/SouthAfricaOct ... aEntry.pdf
It's titled "Dynamic Value Set from a Lookup File."