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
What is the type of ri!recordsToEdit_cdt? Is it a record type variable?
If yes, record type fields are indexed using recordType! domain.
yes its a recordtype, but i have to handle indexes of ri!recordsToDelete_txt
index(index(ri!recordsToEdit_cdt, fv!index, {}), recordType!RecordName.fields.KeyTaskStream, null())
You can index it like this.
Documentation - docs.appian.com/.../reference-records.html
No.the problem is ithere is a check also that if ri!activeTasks_int > 0 the value saved should be null otherwise it should store the value. what it is doing is it makes the entire ri!recordsToDelete_txt as null isntead of making at the specified index only where the condition is met.
A couple of questions
By any chance, is it possible that your condition is reverse or the condition is not getting fulfilled because of the type or value?
activeTasks_int is holding int value
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" ) ),