Welcome to the LimeSurvey Community Forum

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

assign value based on edited passed value

More
2 years 6 months ago #240609 by terryaulenbach
Your LimeSurvey version: 3.28.21+220726
Own server or LimeSurvey hosting: own
Survey theme/template: modified vanilla
==================

I'm trying to edit a string being passed in the URL and then assign it to a short text answer. I can get the text I want in the TEXT of the question, but I can't figure out how to insert it into the default answer.

Example:
URL = survey-system.uni.ca/index.php/XXXX?Exam...Email=student@uni.ca

...so the Course from the URL is SOCI 1033 CIN5 Home and I want to remove the " Home" bit. I can display it the way I want in the text of the question by using {str_replace(' Home', '', Course.shown)}, but I can't figure out how to replace SOCI 1033 CIN5 Home with SOCI 1033 CIN5 as the value of the question called "Course".

Help? 

[img

Please Log in to join the conversation.

More
2 years 6 months ago #240610 by Joffm
Hi,

you capture the course name in the (hidden) question (short text) "Course"
In the next question - where you want to display it - you set the default answer to {str_replace(' Home', '', Course)}

 

Here still not hidden to show.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
2 years 6 months ago #240611 by terryaulenbach
xlnt! Thanks, Joffm!

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose