Name Generation

Discussions about CSEntry
Post Reply
Romij Chowdhury
Posts: 38
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.....
You do not have the required permissions to view the files attached to this post.
Romij Chowdhury
Posts: 38
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 ?
You do not have the required permissions to view the files attached to this post.
justinlakier
Posts: 238
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: 38
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!!
You do not have the required permissions to view the files attached to this post.
Romij Chowdhury
Posts: 38
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
You do not have the required permissions to view the files attached to this post.
Arjun Brti
Posts: 63
Joined: October 15th, 2020, 3:40 am
Location: Nepal

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: 38
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: 63
Joined: October 15th, 2020, 3:40 am
Location: Nepal

Re: Name Generation

Post by Arjun Brti »

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