Help Needed to complete groovy apps

I have been trying to create an apps that will select 6 switches from the hub for 6 events and planning turn on/off as per plan. I can create and select the 6 switches under a list, but could not figure out how to access the selected switch list to call them in a function to control them.

If anyone please willing to help, I can post the codes.

Thank you