So, I am working on Collection variable.
Basically it is from postman 30 days challenge. I’ll explain it in detailed here.
I am talking about collection variable since I want to update a variable named page and get it in another request which is in the same collection but different folder, during this I didn’t face any variable issue but the thing I want to know about is about the INITIAL and CURRENT VALUES and how to persist it from script.
I don’t understand what you mean by “persist” in this context.
The instruction for the submit request is not telling you to use a variable for the request. It’s asking you to physically type in the page number for the query parameter.
It looks like the overview\documentation for the request is taking the initial value of the variables instead of the current value.
Which would be expected behaviour as the current value might be confidential as its used for things like authentication tokens.
Current values are only available locally. They do not get synced to the Postman Cloud or if you export a collection therefore the documentation will never know what values is in there.
I thought it should be passed dynamically because even if we run multiple times it’ll update automatically. Okay, The task doubt cleared now I’ll pass it directly.
What I understand persist is syncing the local value to the postman server as it can be done by this options and reset is vice-versa as shown in the screenshot below.
I can do these in the application, I want to know whether it can be done while setting variables from scripts section.
Yes, I know the credentials are need to be secure and local. But numbers and dummy data’s can be exposed right since I also want to fetch these data’s from another request it will be helpful for that.
It would appear you need to use the Postman API if and edit the collection directly if you want to change the initial values.
Current values are a bit easier, as you can use the unset function which will remove the value, which then causes it to take the initial value then next time its used.