How to call http post API call in before part of gatling?

I’m sort of new to exploring and using gatling. I have played around with http actions and building scenarios to call the http API request actions . But I’m running into an issue where I intend to perform multiple virtual user requests on a update API http operation but my pre-req is that I need the resource created first via a http POST API so as to use the id from response in order to finally perform PUT http call.

So I have both these https action methods defined but I just want to perform POST http action method only once and then use the id from response to perform PUT http action method multiple times to really test performance of this PUT api .
So chained request calls like below in simulation class isn’t the intended way as its running both methods 10 times.

val updateTest = scenario(" test scenario")
  .exec(CreateOperation())
  .exec(UpdateOpeartion())

Did you get an answer for this?

I figured this out

Can you share the code @sowmya?

You could try a loop for only UpdateOperation.