Pass value from script to url


Author
Message
francescodf
francescodf
Partner Member (570 reputation)Partner Member (570 reputation)Partner Member (570 reputation)Partner Member (570 reputation)Partner Member (570 reputation)Partner Member (570 reputation)Partner Member (570 reputation)Partner Member (570 reputation)Partner Member (570 reputation)
Group: Forum Members
Posts: 7, Visits: 170
Hi there,

Is it possible to pass a value of the script as an output parameter via url?

For example I would like to return a parameter d of the iat test at the end of the script http://example.com?dparam=XXXX

Is it also possible to pass these values as POST instead of GET?

Thank you
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
francescodf - Wednesday, December 20, 2017
Hi there,

Is it possible to pass a value of the script as an output parameter via url?

For example I would like to return a parameter d of the iat test at the end of the script http://example.com?dparam=XXXX

Is it also possible to pass these values as POST instead of GET?

Thank you

You can set the URL a web experiment redirects to in a script via the defaults.finishpage propery. That URL can include query parameters, i.e. you'd do something like this:

<expt>
/ onexptend = [defaults.finishpage = text.redirect_to.item(1);]
...
</expt>

<text redirect_to>
/ items = ("http://example.com?subjectid=<%script.subjectid%>&dparam=<%expressions.d%>")
</text>



francescodf
francescodf
Partner Member (570 reputation)Partner Member (570 reputation)Partner Member (570 reputation)Partner Member (570 reputation)Partner Member (570 reputation)Partner Member (570 reputation)Partner Member (570 reputation)Partner Member (570 reputation)Partner Member (570 reputation)
Group: Forum Members
Posts: 7, Visits: 170
Dave - Wednesday, December 20, 2017
francescodf - Wednesday, December 20, 2017
Hi there,

Is it possible to pass a value of the script as an output parameter via url?

For example I would like to return a parameter d of the iat test at the end of the script http://example.com?dparam=XXXX

Is it also possible to pass these values as POST instead of GET?

Thank you

You can set the URL a web experiment redirects to in a script via the defaults.finishpage propery. That URL can include query parameters, i.e. you'd do something like this:

<expt>
/ onexptend = [defaults.finishpage = text.redirect_to.item(1);]
...
</expt>

<text redirect_to>
/ items = ("http://example.com?subjectid=<%script.subjectid%>&dparam=<%expressions.d%>")
</text>



Thanks Dave :)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search