[Solved] How to extract OptionID value from a Csscading Dropdown

0

My account type is Enterprise

 

I’ve a survey with one Cascading Dropdown (with an excel file associated)

There are 3 levels

 

In Custom Scripting, how extract value of the third level

The QID is 414

  • Level 1 is OptionID 11448
  • Level 2 is OptionID 11449
  • Level 3 is Option ID 11450

I want to have the single value (the value of the line chosen by the user), for question (414, 11450)

 

Only to confirm I’ve all I want in the array

%% DSchosen .= sgapiPrint_R(sgapiGetValue(414));                     This is good.

 

So I tried

%%Quest .= 414;

%%Field .= 11450;

%%DSchosen .= sgapiArrayGet(%%Quest,%%Field);

BUT IT DOES NOT WORK

 

Could you see what I would like to explain ?

 

Thanks a lot if you could help

jeanmarcvial answered

    Best answer

    1
    IS 2.20K Rep.

    The function you are using is:

    sgapiArrayGet(%%array,%%index)

    But you are supplying a single value as the first argument instead of an array. I don’t know for sure, but you might try the following:

    %%DSchosen .= sgapiArrayGet(sgapiGetValue(%%Quest),%%Field);

     

    IS selected as best answer
      0

      Thank a lot for your answer

      It works perfectly. It’s exacly what I needed

      jeanmarcvial answered
        ×

        Login

        Question stats

        • Active
        • Views1459 times
        • Answers2 answers
        • Followers1 follower