Adding and retrieving values to a TinyDB list in the background for webhook posting

help
beginner

#1

Hello - new Thunkable user here. Loving the process and have been reading all the tutorials and guidelines in the background - it has been a brilliant reintroduction to the world of coding. I have a query which hopefully someone can help with.

I’ve found various ways of doing this through the tutorials and Google searches but I want these processes to run in the background without user interaction and the TinyDB/List process has been very confusing.

Context: When a user clicks a submit button, the value (in this case an integer in seconds) should get uploaded to an ifttt webhook as the JSON ‘value1’. From a user perspective that is then the end of the story - and I’ve managed to get that bit to work. (So this is not what my query is about).

I’m now building in a redundancy for instances where the user may not have access to the internet (I’ve seen How to check for “connection” and save data on or offline) - all of this should however happen in the background without any user interaction.

  • I want the user to click Submit
  • The value (seconds in a textbox) to be added to a list and saved to TinyDB under a tag (e.g. ‘data2upload’) along with the date
  • Subsequent additional values to be appended to the list and saved under the same tag

Meanwhile

  • When TinyDb has contents, a test internet connection process is triggered to run every x seconds (where db is empty the process shouldn’t run) [this seems to do the trick How to check for “connection” and save data on or offline]
  • If there is a connection, items in the list to be popped off and Posted one by one to the webhook and cleared from the list

What’s the simplest way to make this happen, I’ve been reading all the TinyDB and list tutorials but where these tutorials overlap they seem geared towards users entering data and then viewing the data rather than a background process.