Saving file ID on file upload to Retool Storage

What is the official way to save the unique file ID, when uploading to Retool Storage?

I found I can identify the file ID of the last uploaded file with {{ fileButton1.value[0].fileId }}. So I made an insert query to run on the “Uploaded to storage” event that references this variable, but it saves the fileId of the previously uploaded file. So apparently it is running to soon. I would have imagined that the “Uploaded to storage” event would be the one that would wait until after the file was uploaded and the file ID was generated, but there is no documentation about this feature.

Presumably, I have to delay the insert query until the fileId is updated to match the current file. However, I cannot find any documention on the correct way to do this. I would have thought that practically everyone who uploaded a file to Retool Storage would be saving the File ID somewhere to reference that file later. How are you going about this?