How to increase environment variable when the value is a number?

Hi @Kyortush_13, Welcome to the Community!

Postman stores env variables as strings. In order to perform arithmetic operations on env variables, you need first to parse it as Int then add and again set variable env variable. Please find the below snippet for reference.

Assuming the initial value is stored in variable a.

pm.environment.set("a",parseInt(pm.environment.get("a"))+1);

2 Likes