There are many ways to do it.
If your offline data has multiple records, the simplest design would be to have a gallery showing all the 'Pending' items which were collected, with a 'Submit' button for each to be sent manually. less code, but more effort, as it requires individual resubmissions.
To submit automatically, you will get in the wonderful world of Timers. They are a bit wonky to design and debug, you should read the documentation carefully, and will have to Publish the app several times to test them, as they do not behave the same inside the Studio.
But in a nutshell, you can run a sequence of commands after a timer expires or when it starts, and you can let the timer loop infinitely.
With that, you can:
If(
Connection.Connected,
ForAll(mydata,
If(mydata.temperature > 38,
//do something for this row
);
);
);
);