Translations of this page:
 

multiLevelPrepare()

int multiLevelPrepare(string questionnaire, [array data])

The multiLevelPrepare() function creates a subordinate case in the data set (Multi-Level Structure). Variables in the new case can be pre-assigned. This function is particularly useful in conjunction with a multilevel.

  • questionnaire – The identifier of the questionnaire to be used to process the subordinate case.
  • data – An associative 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 multilevel could be placed here, which allows the respective cases to be called up to enter the personal details.

en/create/functions/multilevelprepare.txt · Last modified: 09.04.2024 16:14 by lukas.kraiger
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki