Skip to main content
February 1, 2024
Question

Update value at current index of array.

  • February 1, 2024
  • 7 replies
  • 0 views

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

7 replies

harshitb6843
February 1, 2024

What is the type of ri!recordsToEdit_cdt? Is it a record type variable?

If yes, record type fields are indexed using recordType! domain. 

February 1, 2024

yes its a recordtype, but i have to handle indexes of ri!recordsToDelete_txt

harshitb6843
February 1, 2024

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