How does restoreVariable work?

I am walking through a collection and the function restoreVariable(pm, foo) is used a lot.
I don’t see any documentation on this. Is it a built-in function?
EDIT: I discovered that it is defined in the collection json file under the “event” section. Where in the UI is this configured?

“event”: [
“listen”: “prerequest”,

Hey Johan,

That looks like someone has added a custom function as part of the Pre-request Script on the collection.

If you’re not able to see it in the individual requests, it’s more than likely at the Folder or Collection level.

If you hover over the Collection and press the 3 dots button, you should see the Edit option in the menu. This will take you to the Collection level elements that include the Pre-request Script.

The same steps can be used on the folders in the collection, to see if something has be added there.

Hi Danny,
Thanks, that was indeed the case. I hadn’t realised that one can define functions in the pre-request script section.