How can I create a dynamic requestbody using a pre-requisite script?

Hey @sergeasmar :wave:

Welcome to the Postman community! :postman:

You could make use of the this technique described by @vdespa in his video:

That would allow you to create the body the in the pre-request script and use that as the payload. You can you the pm.iterationData.get('header_name') function in the dynamic request body to get those values from the data file.

There was also this from @odanylewycz that might be useful too: