Remove Columns From A Collection

Input collection: myTeams43

TeamPerson1Person2Person3
Team AJen PhillipsLeonard PetersenMurray Cole
Team BPercy WaltersAdam DavidsonAlice Lemon
Team CSarah DavyMelissa StevensBernice Friesen


Output collection: mySolution43a (remove Person3 column)

TeamPerson1Person2
Team AJen PhillipsLeonard Petersen
Team BPercy WaltersAdam Davidson
Team CSarah DavyMelissa Stevens


Solution code:

//Create a collection
ClearCollect(myTeams43,
{Team: "Team A", Person1: "Jen Phillips", Person2: "Leonard Petersen", Person3: "Murray Cole"},
{Team: "Team B", Person1: "Percy Walters", Person2: "Adam Davidson", Person3: "Alice Lemon"},
{Team: "Team C", Person1: "Sarah Davy", Person2: "Melissa Stevens", Person3: "Bernice Friesen"}
);

//Remove a column code
ClearCollect(mySolution43a, DropColumns(myTeams43,"Person3"));


Output collection: mySolution43b (show only ‘Team’ & ‘Person1’ column)

TeamPerson1
Team AJen Phillips
Team BPercy Walters
Team CSarah Davy


Solution code:

//Create a collection
ClearCollect(myTeams43,
{Team: "Team A", Person1: "Jen Phillips", Person2: "Leonard Petersen", Person3: "Murray Cole"},
{Team: "Team B", Person1: "Percy Walters", Person2: "Adam Davidson", Person3: "Alice Lemon"},
{Team: "Team C", Person1: "Sarah Davy", Person2: "Melissa Stevens", Person3: "Bernice Friesen"}
);

//Remove multiple columns code
ClearCollect(mySolution43b, DropColumns(myTeams43,"Person2","Person3"));