=CHAIN("https://www.soscisurvey.en/EXAMPLE/?r="; $A2)
Please replace the link ''%%https://www.soscisurvey.de/EXAMPLE%%'' with the [[:en:survey:url|link to your questionnaire]], but please keep the appended ''/?r=''. If you already have parameters in the link, use an ampersand instead of the question mark.
=CHAIN("https://www.soscisurvey.en/EXAMPLE/?q=qnr2&r="; $A2)
If you confirm the formula, the result in the first data line (line 2) should look something like this:
https://www.soscisurvey.en/EXAMPLE/?r=1
Double-click on the corner of the cell to "extend" the formula over the entire table.
===== Database Key =====
You need a similar formula in the ''key'' column:
=CHAIN("cw"; $A2)
The ''cw'' is chosen arbitrarily here, you can accept it unchanged.
Please also extend this formula over the entire table.
The result should look like this:
^ID ^url_to_survey^confirmation_code^key^
| 1 |%%https://www.soscisurvey.en/EXAMPLE/?r=1%%|AB178287|cw1|
| 2 |%%https://www.soscisurvey.en/EXAMPLE/?r=2%%|BB173774|cw2|
| 3 |%%https://www.soscisurvey.en/EXAMPLE/?r=3%%|DX495968|cw3|
| 4 |%%https://www.soscisurvey.en/EXAMPLE/?r=4%%|FC785534|cw4|
===== Import into SoSci Survey =====
Save the table in formal XLSX (Excel 2007-365) and select the function **Special functions** -> **Database for contents** in SoSci Survey. At the top, select the Excel file for import and confirm with "OK". If the table looks correct, confirm with "Next".
In the next step, the "key" column should already be preselected for "Key of entry". For "Language" and "Timestamp", "Not included in the file" should be selected. Confirm with "Next". The result should look like this.
^Key^Language^0^1^2^
|cw1 |ger|1 |%%https://www.soscisurvey.en/EXAMPLE/?r=1%% |AB178287 |
|cw10|ger|10|%%https://www.soscisurvey.en/EXAMPLE/?r=10%%|NA795776 |
|cw2 |ger|2 |%%https://www.soscisurvey.en/EXAMPLE/?r=2%% |BB173774 |
|cw3 |ger|3 |%%https://www.soscisurvey.en/EXAMPLE/?r=3%% |DX495968 |
|cw4 |ger|4 |%%https://www.soscisurvey.en/EXAMPLE/?r=4%% |FC785534 |
**Note:** In the alphabetical sorting ''cw10'' comes before ''cw2''.
For the questionnaire, we only need the key and the confirmation code in the column with the index 2.
===== Display in the Questionnaire =====
In the questionnaire, the URL variable ''r'' is read in as REF, the PHP code has access to it via ''[[:en:create:functions:reference]]''. Please insert an additional page before the "last page" in the questionnaire. The code is displayed there.
// compose database key
$key = 'cw'.reference();
// read out row
$entry = dbGet($key);
// Extract code from the line if the line was found
if ($entry) {
$code = $entry[2];
} else {
$code = 'FAIL:'.reference();
}
// display in the questionnaire
html('Your confirmation code is '.$code.'.
');
===== Submit Codes to Clickworker =====
Upload the table with the links and confirmation codes to Clickworker at the end. To do this, go to "External survey" when creating a new order and then select "External survey (multiple URLs & codes)". After selecting the target group, you can upload the table (Excel or csv format). The table should contain as many links and codes as the number of participants you want to recruit, without additional codes (e.g. generated as a buffer). Otherwise, the number of workers requested in step 1 will be increased and additional costs will be incurred accordingly. You can then confirm the order in the last step.