How can I generate a secure edit link with dynamically updated survey share link?

0

I am trying to generate secure edit links that reflect the specific survey share link through which the respondent started the survey. I can construct everything after the “secure survey share link” part of the URL using a combination of merge codes and static values, but how can I dynamically generate the current share link itself?

 

Justin M. answered
    0

    This custom script worked for me, though there may be a more elegant solution:

    //merge code for edit link
    %%mergeCode = “survey(‘edit link’)]”;

    // id of hidden question to be populated with https edit link
    %%destId = 114;

    //get default edit link from merge code
    %%editLink = sgapiEvaluateMergeCodes(%%mergeCode);

    //find http and replace with https
    %%editLink = sgapiPreg_Replace(“/^http:/i”,”https:”,%%editLink,1);

    //populate hidden question with secure edit link
    sgapiSetValue(%%destId,%%editLink);

    Links:

    Justin M. edited answer
      ×

      Login

      Question stats

      • Active
      • Views411 times
      • Answers1 answer
      • Followers1 follower