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

0 votes

Good morning.

I hope you are doing well! I would like to know if it was possible to program redirects to an external app (In this case, measure protocol)? I am collecting data using an external survey poll, and need to capture their respondents' IDs. I have created two POST/Get variables for a first test, and used this link: https://www.soscisurvey.de/BBEP_survey_main?cid=cidtest01&srid=sridtest01

But the test did not work.

Thank you very much in advance!

Regards,

in SoSci Survey (English) by s139639 (360 points)

7 Answers

0 votes

SoSci Survey workt with a case token to identify the interview. You can access that with caseToken() and the placeholder %caseToken%. Send this case token (eventually along with the case number) to the external tool:

redirect('https://SOME.EXTERNAL.TOOL/?token=%caseToken%&num=%caseNumber%');

Of course, you can give the GET variables different names. The external tool must then store that data and return the case token as parameter "i" to SoSci Survey:

https://www.soscisurvey.de/BBEP_survey_main/?i=[CASE_TOKEN_FROM_SOSCI]
by SoSci Survey (268k points)
Thanks for your answer! Actually, we capture the value of cid and said correctly from the start survey link, e.g. https://www.soscisurvey.de/BBEP_survey_main?cid=testcid03&srid=testsrid03

But when we fire the redirect the redirect loads in the browser correctly but is not passing the values for cid and said in at all

We get this URL result from the redirect

https://sampler.measureprotocol.com/api/v1/survey-completed?cid=%id%&srid=%id2%

Instead of:

https://sampler.measureprotocol.com/api/v1/survey-completed?cid=testcid03&srid=testsrid03 (per the example in the start URL)

Any solution to this problem?
Did you use replace() to configure values for the placeholders %id% and %id2%?

If not, please use replace() before redirect() OR create the URL string with the point as concatenation operator:

redirect('https://sampler.measureprotocol.com/api/v1/survey-completed?cid='.value('IV01_01').'&srid='.value('IV01_02'));

Where IV01_01 and IV01_02 are to be replaced by the variables names that store cid and srid in your dataset.
Thanks for your reply. I have actually tried that,, as well as the replace function before the redirect, but the values for 'cid' and 'srid' in the redirect are both missing.

Any idea why this didn't work?
Most likely, he data is not stored in the internal variables or the variable names do not fit your project.

If you remove the redirect() and write this on the page, what does the debug information show?

debug('IV01_01');
debug('IV01_02');

You find the correct variable names in the question "device and transmitted variables" you employed to read the variables originally in the "variables" tab.
Thanks a lot for your reply. There is no problem with the variable names, but the variables still were not displayed in the dataset. Could it be a problem with the code I've inserted?

if (!isset($id)) {
  $id = readGET('cid');
  // register variable for later use
  registerVariable($id);
}
Sorry for adding many comments. I have inserted some screenshots above so you can understand the problem better
Okay, I see the problem: You have a variable IV01_01, but you never write any contents there. Remove that variable, we won't need it any more. Also remove the PHP code with readGET().

Then take your question RG02, and tell it to record the Variables "cid" and "srid". When you did so, you will new variable names. The question must remain on the first page. Use the new variable names in your value() command.
Thanks a lot for your reply! Unfortunately, the redirects are not working. Is it possible to send the email exchanges I had with "Measure protocol" to one of your e-mail addresses so that we can solve this issue? I have a deadline and need it to be done asap :/ It would be highly appreciated if you could help with that, as I do not exactly unserstand where the problem is (I've tried many things). Thank you very much in advance!
You can foreward the email to info@soscisurvey.de

Please refer to this thread and (!) also include a screenshot of (a) the question that you are using to collect the parameters, (b) of your first questionnaire page and (c) of the page with the redirect() PHP code
0 votes

by s139639 (360 points)
0 votes

by s139639 (360 points)
0 votes

by s139639 (360 points)
0 votes

by s139639 (360 points)
0 votes

by s139639 (360 points)
0 votes

by s139639 (360 points)
...