How do I use the requestID (GUID) in setNextRequest() in the pre-request scripts?

I have a specific request’s GUID that I’d like to use in setNextRequest().

When I send setNextRequest("1212121-df111f22-11f2-1212-1db2-1b0c21dacaab") (but like, the real one), it does not function. Postman runner cannot find the request.

I have tried sending it as not a string, but the pre-request will error.

When I send setNextRequest(“Log Out”) by name, it finds my request and continues on just fine. Using the name is not an option for me. Repeats.

Please help. I’ve googled this a fair bit and nobody shows how to apply it, just how to find the request GUID in the first place. Thanks in advance.

1 Like

Hey @award-bounteous :wave:

Instead of passing the whole request ID, please try only passing “df111f22-11f2-1212-1db2-1b0c21dacaab”.

I hope this helps! :wink:

2 Likes

Thanks! Looks like Postman updated their docs on this too. I bumped into it today while looking for something else:

https://learning.postman.com/docs/running-collections/building-workflows/

Also, beware that the new forks feature will assign a unique GUID to every fork request, as a fork is a copy and that’s how postman deals with copies re: GUIDs for each request. If I find a way to programmatically get GUID, I will update.

1 Like