Hi,
I want to take the value/text(say it is on 4th position) of a muliple response variable into the CAPI window of single response.
For single response we just took %variable name%, what if we have to take variable name of a specific position form multiple response question?
Thanks in advance!
Regards
Vipul
CAPI Question text from Multiple response
-
- Posts: 25
- Joined: March 28th, 2013, 9:17 am
Re: CAPI Question text from Multiple response
You can declare a global logic variable that you use in the question text and assign the value of that variable from the value set using the function getlabel(). For example:
In the question text insert %mycapistring%.
Code: Select all
PROC GLOBAL
string mycapistring;
PROC MYSINGLERESPONSE
onfocus
// Get label from the value set of the multiple response MYMULTIRESPONSE that has the value "D".
mycapistring = getlabel(MYMULTIRESPONSE, "D");
-
- Posts: 25
- Joined: March 28th, 2013, 9:17 am
Re: CAPI Question text from Multiple response
Hi Josh,
I tried to do so but it is not showing the response captured in the string. Can you please have a look in the attached demo file. If any correction required please let me know.
Thanks & Regards
I tried to do so but it is not showing the response captured in the string. Can you please have a look in the attached demo file. If any correction required please let me know.
Thanks & Regards
josh wrote:You can declare a global logic variable that you use in the question text and assign the value of that variable from the value set using the function getlabel(). For example:
In the question text insert %mycapistring%.Code: Select all
PROC GLOBAL string mycapistring; PROC MYSINGLERESPONSE onfocus // Get label from the value set of the multiple response MYMULTIRESPONSE that has the value "D". mycapistring = getlabel(MYMULTIRESPONSE, "D");
- Attachments
-
- Demo.zip
- (4.13 KiB) Downloaded 460 times
Re: CAPI Question text from Multiple response
Excuse me, I am not Josh but I think I can help.
In your example you have the following logic:
PROC Q101_NAME
onfocus
abc = getlabel(Q101_NAME,"2");
This means that you want to assign the label of Q101_NAME to abc for value 2. As Q101_Name does not have any valueset this logic will assign a Blank value to abc. This is why nothing is shown in the CAPI screen. So add a valueset to Q101_Name and you will have a value label for "2" displayed in the CAPI screen.
I don't understand what you really ant to do. Do you want to display the information captured in Q101_NAME000 section in the CAPI screen or something else?
In your example you have the following logic:
PROC Q101_NAME
onfocus
abc = getlabel(Q101_NAME,"2");
This means that you want to assign the label of Q101_NAME to abc for value 2. As Q101_Name does not have any valueset this logic will assign a Blank value to abc. This is why nothing is shown in the CAPI screen. So add a valueset to Q101_Name and you will have a value label for "2" displayed in the CAPI screen.
I don't understand what you really ant to do. Do you want to display the information captured in Q101_NAME000 section in the CAPI screen or something else?
-
- Posts: 25
- Joined: March 28th, 2013, 9:17 am
Re: CAPI Question text from Multiple response
Hi Noel,
Thanks for the explanation. Yes, i want to display the information captured in Multiple response question somewhere else in CAPI Screen only. Is there any way to do that?
Regard
Vipul
Thanks for the explanation. Yes, i want to display the information captured in Multiple response question somewhere else in CAPI Screen only. Is there any way to do that?
Regard
Vipul
Re: CAPI Question text from Multiple response
I think what is confusing is the term "muliple response". That generally refers to items where you have set a of fixed responses from which can you pick more than one and is done with a set of checkboxes. That is what Noel and I assumed you were trying to do and for that you need an alpha item with a vaue set.
What you have in your application is not a checkbox item but a repeating alpha item (aka a roster). To get the value of an a repeating item you need to use a subscript. You do this by putting a number in parentheses after the name of the variable. For example Q101_NAME(1) would get the value in the first row of the roster, Q101_NAME(2) would ge the value in the second row... So if you want to modify your application to display the value from the second row in the question text you could simply change the existing to logic to:
onfocus
abc = Q101_NAME(2);
What you have in your application is not a checkbox item but a repeating alpha item (aka a roster). To get the value of an a repeating item you need to use a subscript. You do this by putting a number in parentheses after the name of the variable. For example Q101_NAME(1) would get the value in the first row of the roster, Q101_NAME(2) would ge the value in the second row... So if you want to modify your application to display the value from the second row in the question text you could simply change the existing to logic to:
onfocus
abc = Q101_NAME(2);
-
- Posts: 25
- Joined: March 28th, 2013, 9:17 am
Re: CAPI Question text from Multiple response
Hi Josh,
Yes it is working.
Thanks Josh & Noel for your support.
Regards
Vipul
Yes it is working.
Thanks Josh & Noel for your support.
Regards
Vipul