0 votes
in SoSci Survey (English) by s208019 (160 points)
edited by SoSci Survey

We are conducting a mutli-wave study, where participants are first asked to do a desktop questionnaire. In the desktop questionnaire, we included an opt-in question that triggers sending an SMS to the consecutive multi-wave mobile questionnaire. We provide instructions and a assign some participant values already during the desktop questionnaire and it is essential that these values are later passed on to the mobile questionnaire. However, it does not seem possible to add parameters to the %opt-in% placeholder? Does anyone have advice how to handle this?

Cheers

1 Answer

0 votes
by SoSci Survey (305k points)

The best solution is to store the values to the database for contents, immediately after doing the opt-in, using the person code created by the opt-in question, as key for the database. This might look like this:

$person = value('OI01');  // Person code from the opt-in question
dbStore('D'.$person, [
  'AB01' => value('AB01'),
  'age' => value('TX01_01')
]);

In the subsequent questionnaires, you can then easily access that data.

$person = caseSerial();
$data = dbRetrieve('D'.$person);
debug($data);
by s208019 (160 points)
Thanks for the quick response and advice! I tried this, however, unfortunately the information stored in $data or $person is then still not visible in the dataset of the mobile questionnaire.
by s273886 (125 points)
Thank you for your help! Can I ask, why do you use `dbStore` and `dbRetrieve` as opposed to `dbSet` and `dbGet`? It seems that the documentation for `dbStore` and `dbRetreive` does not exist: https://www.soscisurvey.de/help/doku.php/en:create:functions:dbstore and https://www.soscisurvey.de/help/doku.php/en:create:functions:dbretrieve. Furthermore, why do you prepend your key with 'D', and not just use the "raw" result of `caseSerial()` as your database key?
by SoSci Survey (305k points)
dbSet() and dbGet() work with indexed arrays while dbStore() and dbRetrieve() - which are quite new - support named arrays, which is easier to handle in some instances.

> unfortunately the information stored in $data or $person is then still not visible in the dataset

Please check the "database for contents" feature in SoSci Survey. Do you see proper entries, there? What does the debug information tell on the pages where you use the PHP codes?

Willkommen im Online-Support von SoSci Survey.

Hier bekommen Sie schnelle und fundierte Antworten von anderen Projektleitern und direkt von SoSci Survey.

→ Eine Frage stellen


Welcome to the SoSci Survey online support.

Simply ask a question to quickly get answers from other professionals, and directly from SoSci Survey.

→ Ask a Question

...