Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Sending data from one survey to another

  • jmdsbussrv
  • jmdsbussrv's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 years 3 weeks ago #133585 by jmdsbussrv
Sending data from one survey to another was created by jmdsbussrv
This is a work-around thought I had to my previous topic on sessionStorage.
Is it possible to send data from one survey to another without using a specific "question" "answer" code.
This is what we want to do:
We have different sales reps who will each have their own landing page (web page). On this page is a link to the survey.
In order to make sure each Rep gets credit for the submission, we used to have a separate survey for each Rep, but having to make changes to every single one became anti-productive. We then went to having the visitor put in an access code, which would tell us which Rep would get credit. Thus, having one survey to make changes to.

So now, we want to eliminate the access code and send the information (i.e. the REP NAME) to the survey from the landing page. The localStorage and sessionStorage options are not working. SO, I am thinking of creating a separate survey (one page) for each Rep that will contain their name in a hidden equation, and then, when the client advances to the next "page" it will actually go to a new survey, which will be the "one" that everyone uses.

So, if each original survey is different, and specific to each Rep, I cannot call an answer to the original survey from the second survey since the survey number will be different each time.

I am probably not making the most sense of this, but is it possible to transfer data between surveys without using the specific survey number? Or is there a simple way of doing this that I haven't thought of?

BTW - We have version 1.92 and cannot upgrade due to server issues.

Thanks.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 3 weeks ago #133589 by holch
Replied by holch on topic Sending data from one survey to another
What is usually done in those cases is adding a variable to the survey link, that you then write into the database. This works pretty well with "panel integration", but I don't know if this is already available in your version, which is pretty old and not supported anymore. If the panel integration is not available in 1.92, then you would have to create a hidden question (via css or Javascript, not via the LS option) and write the variable from the survey link into this hiden question. There should be quite a few descriptions on this in the forum.

You really should consider an upgrade at least to 2.06 (2.5 still has a few hickups, so I don't necessarily recommend it for critical work, but those should be solved within the next few weeks I guess).

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: jmdsbussrv
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 2 weeks ago #133631 by tpartner
Replied by tpartner on topic Sending data from one survey to another
Further to Holch's suggestion, see "Prefilling survey answers using the survey URL" - manual.limesurvey.org/Workarounds:_Surve...using_the_survey_URL

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: jmdsbussrv
The topic has been locked.
  • jmdsbussrv
  • jmdsbussrv's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 years 1 week ago #134298 by jmdsbussrv
Replied by jmdsbussrv on topic Sending data from one survey to another
Thanks, guys. We would love to be able to install the updated version as 1.92 is no longer offered in our CPanel and we can't install it on any other domains as a result. The ADMIN screen is totally blank on the updated version and no one seems to have an answer why that I've seen so far.

I have made some progress, which I'll post in a moment.

The issue is that, for this to work, we need a separate entry survey for each Rep that will then transfer automatically to a single survey that will then transfer the specific information to the new survey. Thus, the URL will be different every time.

Read my next reply to see the progress. Perhaps one of you has a solution that I cannot seem to find for the life of me.
The topic has been locked.
  • jmdsbussrv
  • jmdsbussrv's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 years 1 week ago #134299 by jmdsbussrv
Replied by jmdsbussrv on topic Sending data from one survey to another
OK, so, at the moment, I have been able to transfer information from one survey to another using sessionStorage.

Here is the code used on Equation questions:

ENTRY SURVEY (which will be different for each Sales Rep):

<script>
sessionStorage.setItem('smamaxrepnamelp', 'James M. De Vince');
sessionStorage.setItem('smamaxrepemaillp', 'jamesmdevince');
sessionStorage.setItem('smamaxrepphonelp', '(323) 786-6631');
sessionStorage.setItem('smamaxrepextlp', 'jim');
sessionStorage.setItem('smamaxrepphotolp', 'jamesmdevince');
sessionStorage.setItem('smamaxreppasswordlp', 'XXXXX');
</script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
window.location.replace(" maxexposuresocialmedia.com/B2BAnalysis/i...hp?sid=44444&lang=en ");
});
</script>

So, what happens is the first survey (that has no "Welcome" page) simply sets the sessionStorage items we want and immediately tranfers to the survey we actually want to use. This redirects perfectly.

ACTUAL SURVEY (or SECOND SURVEY) which is the one we actually want to use:

<script>
document.write(sessionStorage.getItem('smamaxrepnamelp'));
</script>

which is placed into an equation question, displays the data perfectly. So, the information transfers from the first survey to the second one, BUT, I cannot seem to get the information to be used in any other areas of the survey.

I tried {xxxx.shown} which works with other questions, but not the JavaScript sessionStorage ones. I tried the String JavaScript. Tried a few other things, including other question types, but although the call to sessionStorage is successful in pulling up the information, I cannot use the information elsewhere in any other questions.

Is this a limitation of using the JavaScript? Perhaps I can only retrieve the information using JavaScript? Any way to take the information pulled up in the JavaScript equation question anywhere else in LimeSurvey?
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 1 week ago #134316 by holch
Replied by holch on topic Sending data from one survey to another
blank pages on the admin are often because of the wrong PHP version.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: jmdsbussrv
The topic has been locked.
More
8 years 1 week ago #134326 by jelo
Replied by jelo on topic Sending data from one survey to another

jmdsbussrv wrote: We would love to be able to install the updated version as 1.92 is no longer offered in our CPanel and we can't install it on any other domains as a result.

If CPanel stand for the controlpanel names CPanel then you seems to have to talk to your provider.
Cpanel itself never offered Limesurvey. Looks like your provider offered one-click installations via a third party tool.

Cpanel itself is simple enough to be able to install an uptodate Limesurvey.
At least if the provider keeps the server and cpanel itself uptodate.

What exact version/build of Limesurvey is currently used?
LimeSurvey version 1.92+ Build XXXXXX

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose