How can I use a variable for a post and delete?

I need help please! I have a couple tests in Postman that are Posts and Deletes. Every time I run the Post, it generates a new “Key”. I would then need to Delete that created Post. How can I get that Delete test to pick up that new key from the Post test case every time I run the collection?

Hi @lwilliam1992

Would you be able to provide a screenshot of what you are referring to?

It sounds achievable at face value but would need to see what’s being returned.

Yes of course!

I would need the number 1 on the Post to change every time and I would need the Delete to pick up that newly created post and delete it.

Do you know what the numbers should be?
Is it just 1,2,3,4, etc.?

To delete, you need to submit the “key” in the URL right?

But that key is in the request body, so do you already know what the key is going to be?

Yes it would be something like 1,2,3,4 etc.

Also yes, when deleting I enter a key in the URL but when running the Post that key is populated. So the key is different every time.