Read Variables Before Reset

Did you try looking through existing posts under this Category?

A few look relevant; eg,

You might try a search in this Category for "ArduinoCloud.Update" ...