How to increment date as a value in post request for each iteration run

I am trying to run collection for multiple iterations but would like to increment the date in post request for each iteration

Suppose I provide date as 20220101 and running collection for 30 iterations.

For each run the date get increment. For Example
Iteration1: 20220101
Iteration2: 20220102
Iteration3: 20220103
Iteration4: 20220104 and so on.

Please help how can I write the code in the pre-req script step to pass the date in the post request for each iteration.

looking for a help for above request. Thank you.

Hi @aerospace-technolog4,

you can do this with a test script step. You would need to setup a collection variable with your initial value of 20220101 and then in your test script increment the variable by one. This variable will then be incremented for the next request.

Here is code for test script:
pm.collectionVariables.set(‘date’, pm.collectionVariables.get(‘date’)+1)

as you can see i am using the postman api to set the variable date. But also using the get api to get the data and then increment by one.