Skip to main content

Comparing fields in a table

Comments

2 comments

  • Official comment
    frevvoSupport Team

    Hi Rita!

    Great question. While the rule builder "error text" only applies to the whole table, you can add a message control column that's set to appear via a business rule(below). A couple of tips:

    • Check "hide label" on the message column
    • On the cell level of the message column, set a BG color to something that will pop. We used #ffcccc
    • In our example we also set the table error text, but that can be left out if the row error message is sufficient

    How it will look when tested:

    Business Rule:

    var Col0_start_index = Table1Repeat.itemAdded ? Table1Repeat.itemIndex : 0;
    var Col0_end_index = Table1Repeat.itemAdded ? Col0_start_index+1 : Col0.value.length;
    var event = form.load;

    Message2.visible = false;
    for (let i=Col0_start_index; i < Col0_end_index; i++) {
    if (((Col0[i].value >= Col1[i].value) || (Col0[i].value >= Col2[i].value)) && (Boolean(Col1[i].value)) && (Boolean(Col2[i].value)) && (Boolean(Col0[i].value))) {
    Message2.visible = true;
    Message2[i].value = 'Incorrect Value Col0 cannot be more than Col1 or Col2';
    Col0[i].status = 'Incorrect Value: Col0 cannot be more than Col1 or Col2';
    }
    else {
    Message2[i].value = ' ';
    }
    }
  • Permanently deleted user

    Thank you....works perfectly

    0

Please sign in to leave a comment.