• Resolved frenchlessons

    (@frenchlessons)


    Hello and thank you for this awesome plugin.

    I’m trying to use values I’ve created in a previous field:

    First field (fieldname18): 
    
    (function() {
    
    // ... 
    
    var resultat_A0 = [pourcentage_A0, reponse_correcte_A0, reponse_incorrecte_A0, sans_reponse_A0];
    
    return resultat_A0;
    
    }
    
    )();
    
    Second field: 
    (function() {
    
      var result = fieldname18;
      return result; 
    }
    )();
    

    The “result” of the second function only gives the first value in the array, and not the others. What am I doing wrong?

    Thanks a bunch.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @frenchlessons

    Please, use the modifiers.

    The plugin preprocesses the field’s values by default to use them in mathematical operations. But by using modifiers like |r you can access the raw field’s value without preprocessing.

    Edit the second equation as follows:

    (function() {
    
      var result = fieldname18|r;
      return result; 
    })();

    The modifiers are described in the highlighted frame in the following section of the plugin documentation:

    https://cff.dwbooster.com/documentation#modules

    Best regards.

    Thread Starter frenchlessons

    (@frenchlessons)

    Thank you so much, it works like a charm!

    I’ve just bought the developer version, mostly for the form processing, email delivery and chart visualisation! Keep up the good work.

    Plugin Author codepeople

    (@codepeople)

    Hello @frenchlessons

    Thank you very much.

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Using values stored in an array’ is closed to new replies.