Pre-documentation display script?

My question:

I use Postman to generate our documentation portal.

Is there a way to intelligently initialize variables in the documentation portal? There are pre-request scripts, but they do not execute before a documentation is displayed.

Hey @vadimberman :wave:

Can you elaborate a bit more on what you mean by “initialize variables in documentation”?
Are you publishing a documentation for your collection where you want to automate edits or something?

If you can share some screenshots demonstrating your workflow and what you are trying to achieve, that would be really helpful :slightly_smiling_face:

Hi @taehoshino,

Thank you for tuning in.

I am publishing a documentation, and I want to automate intelligent initialization.

Here is the documentation: As you can see, many times there is a language variable. I want to initialize it based on the user’s choice on my website.

Another one is the API key. As you can see, currently I just direct them to my portal. But I want to be able to set a cookie in my portal, and just read it using one of these scripts.

Then I’ll be able to display: Ocp-Apim-Subscription-Key: actual_value, and generate the code snippets that the users can actually copy and paste.