incorporate an external link into googlesheet

134 views
Skip to first unread message

Sabrina Köhler

unread,
Mar 11, 2020, 8:23:29 AM3/11/20
to formr
Hi everyone,

I am having the following problem.

I have integrated my formR survey with an external provider. Everything is running smooth so far.

I now want to inlcude a screening question ("have you ever expereinced a flood"). People can then answer 1=never, 2=one time, 3= two times and 4=more than three times.

Now, people that have never experiences a flood are meant to be forwared to a new page (screen_out page) from the provider.

In my googlesheet, I tried to do the following:


explanationsclasstypeoptionalnameshowiflabelchoice1choice2choice3
Erfahrung_2left400
label_align_left
rating_button_label_width150
mc_button
experience_11random == 1**Wie häufig waren Sie in der Vergangenheit bereits persönlich von einem Hochwasser betroffen?**noch nieeinmal zweimal
dreimal oder mehr

















note

stoprandom == 1
experience_11 ==1
paste0('https://survey.maximiles.com/screenout?p=52156&m=', testotest$code)




















This is unfortunately only posting the the link and does not refer the participant to the webpage.

Does anyone know how to incorporate external links into the formR googlesheet?

Thanks in advance!













Cyril Tata

unread,
Mar 11, 2020, 9:04:21 AM3/11/20
to Sabrina Köhler, formr
Dear Sabrina

Do you want the participant to "click" on the link or to automatically be redirected? To make the link clickable, you can put it in an anchor tag like

<a href="`r paste0('https://survey.maximiles.com/screenout?p=52156&m=', testotest$code)`">Click Here</a>

If you want an automatic redirection you might need to use JavaScript.


best
Cyril


--
You received this message because you are subscribed to the Google Groups "formr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to formr+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/formr/2c36e93c-4260-42e4-9dee-84c9e1b756c5%40googlegroups.com.

Sabrina Köhler

unread,
Mar 11, 2020, 9:18:04 AM3/11/20
to formr
Hi  Cyril,

thanks for your quick reply. I want people to get automatically redirected to the new webpage. Do you have any idea how I would need to do that with Java Script?
 
Thanks!

Sabrina
To unsubscribe from this group and stop receiving emails from it, send an email to fo...@googlegroups.com.

Cyril Tata

unread,
Mar 11, 2020, 9:51:06 AM3/11/20
to Sabrina Köhler, formr
You could replace the "label" of that item with the following  <a href="`r paste0('https://survey.maximiles.com/screenout?p=52156&m=',  testotest$code)`" class="maxmiles-link">Please click here if you are not automatically redirected</a>  

The in your Run > Settings > JS insert the following (you need to test obviously)

$(document).ready(function() {
    var $anchor = $('a.maxmiles-link');
    if ($anchor.length && $anchor.is(':visible')) {
        document.location = $anchor.attr('href');
    }
})





To unsubscribe from this group and stop receiving emails from it, send an email to formr+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/formr/70efcda9-4a96-40bf-a3c9-e7169a93ee08%40googlegroups.com.

Sabrina Köhler

unread,
Mar 11, 2020, 10:12:19 AM3/11/20
to formr
Hy Cyril,

Thank you for that code. I incorporated it but it still does not seem to work.

Here is a picture of my googlesheet:
explanationsclasstypeoptionalnameshowiflabelchoice1
Erfahrung_1
left400
label_align_left
rating_button_label_width150
mc_button
experience_11random == 1
**Wie häufig waren Sie in der Vergangenheit bereits persönlich von einem Hochwasser betroffen?**noch nie

note

stoprandom == 1
experience_11 ==1

and here is how the webpage looks like, when I test it:


Any ideas what else I can try?

Thank you so much with your help!

Cheers,

Sabrina

Sabrina Köhler

unread,
Mar 11, 2020, 4:21:41 PM3/11/20
to formr
Hi Cyril,

I found a way to work around it the modules you can use in your runs. But there is still a bug. Maybe you have an idea how I can fix that.

I used different runs but I run into the same bug over and over again.

RUN 1:
Pos. 10. a survey (test1). In the sheet I used the comand random 1,2 because I wanted to manipulate the order participants answer two blocks of question (1= flood expereince, then group identification; 2= group identification, then flood experience)
Pos. 20. a Skip Forward which checks (in random==1) testotest$expereince_11 > 1. If the person has experienced a flood, it skips forward to pos 40.
Pos. 21. a External Link from the provider to the screen out page from provider
Pos. 30. a Skip Forward which checks (in random==2) testotest$expereince_12 > 1. If the person has experienced a flood, it skips forward to pos 40.
Pos. 31. an External Link from the provider to the screen out page.
Pos. 40. a survey (test2) that all people do that have experienced a flood in the past no matter what condition they belonged to before.
Pos. 50. an External Link from the provider to the study complete page.

RUN 2:
Pos. 10. a survey (test1). In the sheet I used the comand random 1,2 because I wanted to manipulate the order participants answer two blocks of question (1= flood expereince, then group identification; 2= group identification, then flood experience)
Pos. 11. a Skip Forward which checks (in random==1) testotest$expereince_11 > 1. If the person has experienced a flood, it skips forward to pos 40.
Pos. 12. a External Link from the provider to the screen out page from provider
Pos. 20. a survey (test1). In the sheet I used the comand random 1,2 because I wanted to manipulate the order participants answer two blocks of question (1= flood expereince, then group identification; 2= group identification, then flood experience)
Pos. 21. a Skip Forward which checks (in random==2) testotest$expereince_12 > 1. If the person has experienced a flood, it skips forward to pos 40.
Pos. 22. an External Link from the provider to the screen out page.
Pos. 40. a survey(test2) that all people do that have experienced a flood in the past no matter what condition they belonged to before.
Pos. 50. an External Link from the provider to the study complete page.

In both run scenarios the random==1 group works as intended, but the random==2 group does not on the survey next page immediately redirect to the external link (Pos. 30 (run1) or Pos.22 (run2)). Instead the survey layout is blank with no buttons or text. Just blank. If I then use the "monkey mode" tool in the test run an click on "go to next step in run" the appropriate pages do appear.

I have no idea how to get read of that blank page. Do you have any ideas?
I attached both excelsheets (test1 and test2). I am wondering if the mistake is in the section where I put my run together or in those sheets.

Any help is much appreciated. Thank you!

Cheers,

Sabrina


On Wednesday, March 11, 2020 at 1:23:29 PM UTC+1, Sabrina Köhler wrote:
Test1.xlsx
Test2.xlsx

Sabrina Köhler

unread,
Mar 11, 2020, 4:28:45 PM3/11/20
to formr
Short update. It must have something to do with the run section. I just changed the order of the forward link conditions (swapped postions). And now I have the same problme with the other group.

Cyril Tata

unread,
Mar 12, 2020, 5:47:39 AM3/12/20
to Sabrina Köhler, formr
Please can you send me your run export in private (include survey definitions)?

image.png

best
Cyril


--
You received this message because you are subscribed to the Google Groups "formr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to formr+un...@googlegroups.com.

Sabrina Köhler

unread,
Mar 12, 2020, 6:23:03 AM3/12/20
to formr
Thank you, i send an e-mail to your account at uni of göttingen.
To unsubscribe from this group and stop receiving emails from it, send an email to fo...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages