Welcome to the forums, guys
It definitely is possible, in much the same way you've got it there, ezol.
I'd suggest not making the group name local though (_grp), as then you can use it in the mission editor and triggers as well.
When I spawn groups in, I generally have one guy off the map area somewhere (offshore on an island), in a group called
newgrp.
I then createunit the leader of my created group into
newgrp, and join him to GrpNull.
Then I do what you did, and assign him a group name by:
grpname = group
spawnedguyThen I can create the rest of his group into
grpnameThe disadvantage with using the same local variable over and over is that you'll get (very wierd) errors if you spawn more than 12 guys into the same local variable