'Get' item commands in variable

I know that you can set the ammount of an item gained by the various Get Item or Gold commands as a variable. But can you do the opposite and get the id of item, ammount of gold, etc, and assign it to a game variable? I really want to common event treasure chests as much as possible so I don't need to replace them or edit them each time they need changing. If I can aquire the contents of the chest this way I can refer to it in the message box easily.
of course - that is one of the main functions of the control variable command. Just use the "game data" option.

Original thread: https://forums.rpgmakerweb.com/threads/get-item-commands-in-variable.103373/