(Reserved Server Teleporting) What is a good way to call a players data even if they aren't in the game?

I have a system like this:

Player1 and Player2 are inside a public server.
Player1 clicks a button and it saves a reserved server access code to his data.
Player1 is then then teleported to a reserved server using the access code that was generated.

Now the issue I’m having is even though I have a webhook where I can see the access code then copy and paste the access code of Player1’s server and teleport Player2 there manually. I want to create a system where Player2 can type into a textbox Player1’s UserID and the game will look up Player1’s data and find the saved access code he has and return it, so then Player2 will have the required access code and be able to teleport into Player1’s reserved server.

I’m already able to save all the data using DataStoreService. I’m not sure if I have to make it global to be able to create this function.

If I was not clear enough with what I needed help on, I’ll try to make myself more clear with a reply to your question!