Loop Through and Delete Items

Solved4.56K viewsScripting
0

In scripting, I need to know the syntax to delete items where a cell value is not equal to a specified value. For example:
[attachment=1:217udo9n]delteitems.JPG[/attachment:217udo9n]
In the screen shot I want to loop through each “Use” entry and remove from Matrix 1 via a script the items in category B that have a “Use” not equal to “YES”.

Attachments

delteitems.JPG
2

|Matrix1::B|.items.each
{
if (!|Matrix1|.getSelection(it, |Matrix1::Use|).value.equals(“YES”))
it.delete()
}

Thanks to the IDBS Support desk on this one. As a note the exclamation point “!” in the “if” function is “not equals”. If you wanted to removed all “YES” items instead then simply remove the “!” from the “if” function.

Latest Questions

Wrap text in scripted buttons? 1 Answer | 0 Votes
Claculate product 2 Answers | 0 Votes
Sum by group in the same matrix 4 Answers | 0 Votes
Constrain input – varchar 1 Answer | 0 Votes