Save object to inventory and spawn it

Hello everyone, I’m trying to create an inventory system. For this i need to save the object and then spawn it.
I solved the first problem : AActor* CopyOfActor = DuplicateObject(Actor, this); - save the copy of Actor.
But now i need to spawn Actor back.

In the documentation I found mention about Template - “An AActor to use as a template when spawning the new Actor.”
This is what i need ? Or i need to use deferred spawn ?

Deferred spawn does not work as needed. So need to use - template…But how ?

SpawnParams.Template = CopyOfActor; - it works as i need !