====== multiLevelPrepare() ====== ''int **multiLevelPrepare**(string //questionnaire//, [array //data//])'' The ''multiLevelPrepare()'' function creates a subordinate case in the data set ([[:en:create:multilevel]]). Variables in the new case can be pre-assigned. This function is particularly useful in conjunction with a [[:en:create:questions:multilevel]]. * //questionnaire// -- The identifier of the questionnaire to be used to process the subordinate case. * //data// -- An associative [[:en:create:array|Array]] of variable names and values, which values are to be pre-assigned in the new case. Only one case with the specified data is created at a time, even if the function is called several times. * It is therefore unproblematic if the page is executed several times with the call. * If several cases are to be created, the transferred //data// must vary. ===== Return Value ===== The function returns the case number (CASE) of the newly created case in the data record. ===== Example ===== The following PHP code creates a subordinate case for each name in the list ''$names'' in the data record for the questionnaire ''personaldata'' and saves the name in the variable ''TX01_01''. foreach ($names as $name) { multiLevelPrepare('personaldata', ['TX01_01' => $name]); } Below the PHP code, a question of the type [[:en:create:questions:multilevel]] could be placed here, which allows the respective cases to be called up to enter the personal details.