Name Generation

Discussions about CSEntry
Post Reply
Romij Chowdhury
Posts: 33
Joined: August 19th, 2023, 6:06 am

Name Generation

Post by Romij Chowdhury »

When i enter a name on this empty box in the picture.....
Attachments
1.jpg
1.jpg (95.4 KiB) Viewed 6973 times
Romij Chowdhury
Posts: 33
Joined: August 19th, 2023, 6:06 am

Re: Name Generation

Post by Romij Chowdhury »

Name will be generated automatically in the option list........what will be the logic of this please can anyone tell me ?
Attachments
2(Edit).jpg
2(Edit).jpg (472.19 KiB) Viewed 6972 times
justinlakier
Posts: 152
Joined: November 21st, 2022, 4:41 pm

Re: Name Generation

Post by justinlakier »

This logic is Dynamic Valuesets. In the preproc of the options list, you can add something like this code, found in the help documentation for the ValueSet Object. Rather than creating a new ValueSet object, you can also refer to an existing value set for the options list in your dictionary. Using valueset.add and setvalueset, you can change the options to include data based on the contents of NAME. In this example it is assumed that NAME is multiply occurring in a PERSON_REC record we can loop through to get all names.
PROC RESPONDENT
preproc

    ValueSet
respondent_valueset;

    do numeric counter = 1 while counter <= count(PERSON_REC)
            [/color]respondent_valueset.add(NAME(counter), counter);
    enddo;

    setvalueset(RESPONDENT, respondent_valueset);
Hope this helps,
Justin La Kier
Romij Chowdhury
Posts: 33
Joined: August 19th, 2023, 6:06 am

Re: Name Generation

Post by Romij Chowdhury »

can you do this with my Zip file i cant get it, please make the logic correct for me on "Module A1" name will be entered in "GU_A1_A2" section and option will be generated in "GU_A1_A6c" .....advance thank you!!
Attachments
Kent.Guardian.rar
(62.06 KiB) Downloaded 324 times
Romij Chowdhury
Posts: 33
Joined: August 19th, 2023, 6:06 am

Re: Name Generation

Post by Romij Chowdhury »

What is the solution of it?
My Cspro version is 7.7.3
Attachments
Name.jpg
Name.jpg (288.09 KiB) Viewed 6940 times
Arjun Brti
Posts: 49
Joined: October 15th, 2020, 3:40 am

Re: Name Generation

Post by Arjun Brti »

Valueset is used for numeric variable. Your var is string so you should used "Valueset string Respondent_valueset".
Romij Chowdhury
Posts: 33
Joined: August 19th, 2023, 6:06 am

Re: Name Generation

Post by Romij Chowdhury »

i cant make a solution.......can anyone please do for me with my zip file which is already uploaded earlier?
Arjun Brti
Posts: 49
Joined: October 15th, 2020, 3:40 am

Re: Name Generation

Post by Arjun Brti »

Try by changing your var from string to numeric.
Post Reply