To remove tags from rec use commit function.

If you want check some condition before you can use if.

Example:

We have a grid of recs and want to remove "tagToRemove" (it can be any type, in this case - number) if value of "remove" tag is true.

Function sample: 

removeTagsIf.axon
() => do

//find all recs we want to change according to some condition
  grid1: readAll(tagToRemove)
 
//check each rec in a loop and change it if condition is true
  grid1.each (row => do
    if (row.has("remove") and row["remove"] == true)
		diff(row, {-tagToRemove}).commit
  end)
end

Result is:

readAll(tagToRemove)

  • No labels