Is there a way to use a lua script to pipe options?


I want to be able to use a lua script to pipe arbitrary arrays into options of a radio button. The closest thing I have found is the setpipevalue function, which only repeats the question. I need to do option piping though. Is there a way to achieve this?

Jim W (Moderator) answered

    I wonder if the hideoption function might be a good starting point:

    Since Option Piping essentially shows answer options based on what was selected in a previous question, perhaps you can use a combination of the above function and to mimic option piping.

    Hope this helps!

    Dominic Sharpe answered

      I also would like to know this, did you ever get further with this? 

      Alison90 answered

        Hi Alison90,

        I have never used LUA to set up options for a radio button question.  However,we have had to do something similar a couple of times.  Our approach was to create an auto-submit page with open textbox questions.  The page had a LUA script that assigned values to some of the questions.  For other textboxes we used merge codes from previous questions.  The radio button question appeared on the following page, and we used merge codes from the text boxes on the admin page to populate the answer options.

        This worked well from the respondent’s point of view.  We had to do some extra work to get the reporting values of the radio button question to get the response data export into usable shape.  We also had to edit the merge codes to get the values that we wanted.  Review the SG documentation ( to understand the difference between an option title and an option value.

        Good luck,



        Jim W (Moderator) edited answer


          Question stats

          • Active
          • Views1691 times
          • Answers3 answers
          • Followers1 follower