Issue with `{{index}}` Returning Null When Trying to Generate Incremental IDs

Hi Apidog team,

First, thanks for the awesome tool! I’m currently trying to generate mock data with incremental IDs using {{index}} in my responses.
However, when I add {{index}} , the IDs are returning as null instead of the expected index values.
I want to be able to generate incremental IDs automatically across multiple endpoints without having to create exceptions or custom rules for each one. Is there a recommended way to use {{index}} correctly, or any other method to achieve this ?

Thanks for your help!


Response_Run.png

Please try using {{$helper.autoIncrementEnvVar}} instead and see if it meets your needs.

Thank you for the suggestion! It works well, but is there a way to reset {{$helper.autoIncrementEnvVar}} to start from 1 for every new request ?

The {{index}} value will reset to 1 each time you refresh the client.

but when i use {{index}} or {{$index}} the IDs are returning as null instead of the expected index values.

If you want the counter to start from 1 on every request, it would always be 1 and lose its increment functionality. Currently, {{$helper.autoIncrementEnvVar}} requires a client restart to reset.

I understand that {{$helper.autoIncrementEnvVar}} requires a client restart to reset, but my goal is to generate a list where the id is simply the index + 1 of each item in the list, so starting from 1. Is there a way to achieve this dynamically without relying on autoIncrementEnvVar ?

To achieve dynamic incremental IDs starting from 1 for each request, we recommend using Mock scripts. Please refer to: Mock scripts - Apidog Docs

I am truly happy with the support you have provided. Thank you for your excellent assistance and dedication!