I don’t think step one is showing a deleted action; rather, you are building two separate lists and getting a cross-product.
names of BES actions,ids of bes actions
Is syntax similar to
Which would yield the cross product
…and so on.
What you want on the first query is to loop the actions once and pull two properties from each action -
(names of it, ids of it) of bes actions