⟵ hearthere ⟶
  • Training course
  • Creating simple tables and fields
  • Codes base level
  • Selects and links between tables
  • Table settings basic level
  • Prefilters base level
  • Conditional formatting basic level
  • Action codes base level
  • Using pop-up windows
  • Cycles base level
  • Roles and users on the web
  • Codes advanced level
  • Action codes advanced level
  • How can I get the previous value of a field and use it in the action code?
  • Strong action blocking by server conditions
  • At what moment is the data for the action codes taken?
  • Cross-execution of actions
  • Opening a nested temporary table and returning data to the parent table
  • Features of calling linkToInput and linkToButtons from popups
  • Relative list and number changes via set
  • Inserting rows after a certain row when sorting by order field
  • Using listReplace to execute actions
  • Using the panels of other tables
  • How to open the file upload window?
  • Using an arbitrary form in linkToInput
  • How to perform actions on the rows highlighted with checks?
  • Prefilters advanced level
  • Field and table settings advanced level
  • Cycles advanced level
  • Formatting advanced level
  • Select-Tree
  • Executing a scheduled action code
  • Printing and emailing
  • Notifications
  • API interaction
  • Adaptivity and Sections
  • Using listReplace to execute actions

    An example of the execution of actions in a loop with a condition check

    listReplace can be used not only in codes, but also in action codes to perform actions.

    In this case, on each iteration, it will perform the specified action. Of course, on each iteration, you can perform a check and do nothing if the check is not passed.

    For example, we will add +1 to the field if the list value is even (divisible by 2 without a remainder):


    =:
    listReplace(list: $list; action: $if; value: "val") list: listNumberRange(min: 0; max: 10; step: 1) if: if(condition: math`$round - $division` = 0; then: $action) division: $#val / 2 round: round(num: $division; type: "up"; step: 1; dectimal: 0) action: set(table: 'table'; field: 'field' + 1)