Re-presenting end-users with their previous responses

From Lifeguide Wiki
Jump to navigation Jump to search

Re-presenting end-users with their previous responses

The save, load and saveandload key commands can be used to re-present end-users with responses that they have entered in previous interactions in the intervention. This logic saves the responses that they give and then loads it when it is needed so it can be used both within a single intervention session and across later sessions once the end-user has logged out.


N.B. To save information between sessions you will need to write logic to allow end-users to Create User Accounts.


Re-presenting responses on the same page

This is useful if your page has a number of links that an end-user may click on when using that page or if the page will be re-shown to the end-user at a later point in the intervention. It is also useful if the end-user is likely to re-do the session at a later date and you don’t want them to have to repeat the interactions they have already completed. To do this you will need to use the key command saveandload after the page that you want to re-present. You can chose to re-present every interaction on a page using the basic formula:


saveandload pagename1 for username


This will save all the responses given to all the interactions on pagename1 for each end-user and will load them the next time they visit that page so that they can see their responses and change them if they want to.

Or you can re-present specific responses on the same page. E.g.


saveandload pagename1.interaction1, pagename1.interaction2 for username


This will save the responses given to interaction1 and interaction2 on pagename1 for each end-user and will load them the next time they visit that page so that they can see their responses and change them if they want to.


N.B. If end-users change their responses in a later session, when it is re-shown their original responses will still be recorded on the spreadsheet when you export your data.


Representing responses on a different page

Responses to interactions can be saved and then loaded (or shown) on different pages in the session or in a new session.

Saving Responses

You can chose to save all of the interactions on a page as in the example below:


save pagename1 for username


This will save all interactions on pagename1 for each end-user.

Or you can also chose to only save specific interactions on a page using the following logic:


save pagename1.interaction1, pagename1.interaction2 for username


This will save interaction1 and interaction2 on pagename1 for each end-user. These can then be displayed within an interaction so it can be edited or as a variable where it cannot be edited using the loading logic above.

Loading Responses

You can then load the response an end-user gave in an interaction on a previous page to a new interaction on a later page. This is useful if you want to re-show something they entered before as it may have changed since the last time they responded or they may want to edit their responses.

To load an interaction you need to use the set and default commands as in the example below:


Set default pagename10.interaction2 to load pagename1.interaction1 for username


Assuming that pagename1 was saved, this line of logic will load the response that the end-user gave in interaction1 on pagename1 into interaction2 on pagename10. End-users can then choose to edit the responses they gave in this response if they want to before moving onto the next page.

You can also load the response an end-user gave in an interaction onto a later page by loading it at as a variable that cannot be edited.

To do this you need to set a word as a variable in a text box using the set as variable function (see text boxes for more information). This will use the following logic (note that unlike re-showing information in interactions this does not need the default command).


set pagename10.variable2 to load pagename1.interaction2 for username


This will then load whatever the response that was given in interaction2 on pagename1 as the variable set on pagename10.