30 Days Developer Challenge - Day 12 - `collection_uid` set as environment variable in `Postman API env`

In the collection named Day 12: Postman API, collection_uid is set as environment variable when creating the environment named Postman API env as part of the day’s challenge. This restricts a user from setting the collection_uid as a collection variable to be used in submit request inside Submit your solution folder for all upcoming days’ challenges Postman API env is to be used.

This restriction is due to the scope of variables where an environment variable overrides the collection variable.

For an instance, in Day 13: Newman, the submit request uses the Postman API env as the environment which has a variable named collection_uid. The value of this variable corresponds to Day 12: Postman API collection. Thus, a user cannot set a collection variable collection_uid in Day 13: Newman collection because the environment variable will always take precedence. If not done so, the test cases will fail. In such a case, the user cannot use the request URL https://api.getpostman.com/collections/{{collection_uid}} and instead has to type in the entire collection ID in the request URL as a string literal.

Can we change the documentation of Day 12: Postman API to set collection_uid as the collection variable instead of environment variable?

1 Like

Hello @srishtigupta9,
I have come across this as well while completing the challenge. But, I do not think the documentation has to be changed because there’s a simple workaround:
Just update the collection_uid environment variable in the pre-request scripts for all days after Day 12. This way, each time the test is evaluated the collection_uid is dynamically updated to that of the current collection.


When I am attempting to complete Day 12 for the 30 Day Challenge, when I submit my solution, three of the tests are getting failed.

Hmm, I see. I need you to check some stuff.
Do the tests for the individual requests pass?
If no, is your auth type for the collection set to API Key?

Let me know if that helps.

yes, I am done with that but still getting failed three of the tests.

yes, this helps me but still get this.

You are good to go!
The animation for Day 12 always had an issue.

Have fun with Day 13!

1 Like