• Resolved fibbu

    (@fibbu)


    Hello;
    I defined some criteria for the code below. But I need an additional criterion. How can I print a ‘NULL’ error message if the resultText value is text?

      if (fieldname17 === 'E') {
        resultText = kriter4 < 60 ? '<span style="color: red;">Ba?ar?s?z</span>' : '<span style="color: green;">Ba?ar?l?</span>';
      } else {
        resultText = kriter4 < 70 ? '<span style="color: red;">Ba?ar?s?z</span>' : '<span style="color: green;">Ba?ar?l?</span>';
      }
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @fibbu

    I don’t understand the condition you want to check …resultText value is text.

    The variable resultText contains a text because the code provided assigns a text to it:

    resultText = kriter4 < 60 ? '<span style="color: red;">Ba?ar?s?z</span>' : '<span style="color: green;">Ba?ar?l?</span>';

    or

    resultText = kriter4 < 70 ? '<span style="color: red;">Ba?ar?s?z</span>' : '<span style="color: green;">Ba?ar?l?</span>';

    Both pieces of code assign a text to the resultText variable.

    Best regards.

    Thread Starter fibbu

    (@fibbu)

    Sorry, I was going to write the criterion 4 value, I wrote it wrong.
    If the criterion 4 value is not a numeric value, write the text ‘NULL’.

    Plugin Author codepeople

    (@codepeople)

    Hello,

    You can insert a piece of code as follows:

    if( isNaN(kriter4) ) return 'NULL';

    Bes regards.

    Thread Starter fibbu

    (@fibbu)

    thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Criteria Problem’ is closed to new replies.