Postman pre request script get id

i have a put method, and i need to a pre request script that makes a post request to create user data, and have another get request in same script to get by id from user data and put it to variable. I dont know hot to get that id from the get method in same script