Here is what I NEED to do:
.feed(\"users.csv\") // includes username, password, groupid
// login...
.duration(x) {
feed( csv(\"${groupid}.csv\")
Feeders are instanciated at the same time as the Simulation. You can't defer it to the Simulation runtime, unless you hack with the underlying tools.
How many of those "groupid" files do you have? If you have just a few of them, you can use either doSwitch from Gatling 2 current snapshot, or embedded doIf blocks if you run with Gatling <= 2M3a.
.doSwitch("${groupid}") (
"foo" -> feed(csv("foo.csv").random),
"bar" -> feed(csv("bar.csv").random)
)
This can be generalized:
def groupIdFeed(groupId: String) = groupId -> feed(csv(groupId + ".csv").random)
.doSwitch("${groupid}") (
groupIdFeed("foo"),
groupIdFeed("bar")
)