Update value at current index of array.

a!save(
ri!recordsToDelete_txt,
if(ri!activeTasks_int > 0,
null,
append(
ri!recordsToDelete_txt,
index(index(ri!recordsToEdit_cdt, fv!index, {}), "KeyTaskStream", null())
)
)
),

In the code above ri!recordsToDelete_txt is a list of text. what I want is when user clicks on a button it checks for value in ri!activeTasks_int if its greater than 0 the value saved at current index of ri!recordsToDelete_txt should not be saved else the value should be saved. whats happening iwth my cureent code is that in one flow it works fine but if I click on record having value of  ri!activeTasks_int >0 in the 2nd flow it makes the entire rule input at all indexes as null. i want to store value if condition doesnot meets. thanks

  Discussion posts and replies are publicly visible

Parents Reply Children
  • Certified Lead Developer
    in reply to Sadia_Rashid

    The code seems to be written correctly if you have already verified all the above points I mentioned. In such a situation, what I prefer doing is to isolate the situation. Which means to identify which block of the code is causing this problem. Try adding just simple text values in your if() statement like "True Block" and "False Block" to see if the condition is correct, if the true block is causing this issue or the false block. Then when you find the block, you can isolate the further code to see what is going wrong. 

    a!save(
      ri!recordsToDelete_txt,
      if(
        ri!activeTasks_int > 0,
        "True",
        "False"
      )
    ),