# Offline data upload - Labels, Variables & Looping

**URL:** https://community.thunkable.com/t/offline-data-upload-labels-variables-looping/2931064
**Category:** Questions about Thunkable X
**Created:** [April 5, 2024, 2:58pm UTC](https://community.thunkable.com/t/offline-data-upload-labels-variables-looping/2931064 "2024-04-05T14:58:26Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![nuuzonessqnzvv](https://avatars.discourse-cdn.com/v4/letter/n/bbce88/32.png) [@nuuzonessqnzvv](https://community.thunkable.com/u/nuuzonessqnzvv)
#### Post date: [April 5, 2024, 2:58pm UTC](https://community.thunkable.com/t/offline-data-upload-labels-variables-looping/2931064/1 "2024-04-05T14:58:26Z")

</div>

Hi all,

I’m working on a scavenger hunt app. It requires offline data storage before uploading a google sheet as the hunt takes place in areas of poor service.  
The data (name/number - variables & timestamp/QRdetails - labels) are saving correctly into the offline storage, as seen in the img below with the three times.

 ![Local Tag Times](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/d/3d4824bc5217f9dde6e1515e25a9ea745701996b.jpeg)

However, when I then try to upload this data to a google sheet it has no problem calling the name/number which are both variables but will not include the timestamp & QR details. This can be seen below.  
It also uploads to Google one more set of data than recorded in the offline data. E.g. 3 tags scanned in 1st img, but when uploading it sends 4 tags. Why is this?

![Google Tag Times](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/e/0efe7dbf2392e978c4fabd7f8e7772bea46036ef.png)

The images of the page & blocks are seen below.

 ![QRScan Blocks](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/b/2bce306378db85b4cecd4be4cf49ec3ca155818a.png)  
 ![QRScan Screen](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/b/4bda536a47c16cfecf191444162a192e3c7fea73.png)

---

<div class="post-metadata">

### Author: ![matt\_conroy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/matt_conroy/32/150843_2.png) [@matt\_conroy](https://community.thunkable.com/u/matt_conroy)
#### Post date: [April 12, 2024, 3:02pm UTC](https://community.thunkable.com/t/offline-data-upload-labels-variables-looping/2931064/2 "2024-04-12T15:02:31Z")

</div>

Hi @nuuzonessqnzvv, thanks for your patience.

Were you able to get this sorted?

---

<div class="post-metadata">

### Author: ![nuuzonessqnzvv](https://avatars.discourse-cdn.com/v4/letter/n/bbce88/32.png) [@nuuzonessqnzvv](https://community.thunkable.com/u/nuuzonessqnzvv)
#### Post date: [April 12, 2024, 4:54pm UTC](https://community.thunkable.com/t/offline-data-upload-labels-variables-looping/2931064/3 "2024-04-12T16:54:58Z")

</div>

Hi @matt_conroy

I have not been able to get this sorted yet. Are you able to provide any guidance?

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [April 12, 2024, 7:34pm UTC](https://community.thunkable.com/t/offline-data-upload-labels-variables-looping/2931064/4 "2024-04-12T19:34:19Z")

</div>

Hello @nuuzonessqnzvv 👋  
I think I understand the feature you are trying to build and another way to implement it is this:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/f/cf21c8d971369246b233b6485a819f8fa2b76fb6.png)

As making to many updates in a sort period can exceed the limit of google APIs, I suggest every time you upload a row to delete it from the local table so you don’t upload it again in the future:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/5/85563b401c8799f1f2d2753274cf27ad3e471328.png)

---

<div class="post-metadata">

### Author: ![nuuzonessqnzvv](https://avatars.discourse-cdn.com/v4/letter/n/bbce88/32.png) [@nuuzonessqnzvv](https://community.thunkable.com/u/nuuzonessqnzvv)
#### Post date: [April 12, 2024, 8:50pm UTC](https://community.thunkable.com/t/offline-data-upload-labels-variables-looping/2931064/5 "2024-04-12T20:50:13Z")

</div>

Hi @ioannis

That has worked a treat thank you. Is it possible to upload the whole of the offline table to the google sheet, instead of pressing finished for each entry in the offline table?

Thank you

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [April 12, 2024, 8:58pm UTC](https://community.thunkable.com/t/offline-data-upload-labels-variables-looping/2931064/6 "2024-04-12T20:58:45Z")

</div>

Hi @nuuzonessqnzvv  
Unfortunately it is not possible to create multiple rows with data source block. You could use Web API block.

---

<div class="post-metadata">

### Author: ![nuuzonessqnzvv](https://avatars.discourse-cdn.com/v4/letter/n/bbce88/32.png) [@nuuzonessqnzvv](https://community.thunkable.com/u/nuuzonessqnzvv)
#### Post date: [April 12, 2024, 9:26pm UTC](https://community.thunkable.com/t/offline-data-upload-labels-variables-looping/2931064/7 "2024-04-12T21:26:15Z")

</div>

Evening @ioannis

Ahhh ok thank you for your help anyways 🙂

---

<div class="post-metadata">

### Author: ![nuuzonessqnzvv](https://avatars.discourse-cdn.com/v4/letter/n/bbce88/32.png) [@nuuzonessqnzvv](https://community.thunkable.com/u/nuuzonessqnzvv)
#### Post date: [April 15, 2024, 7:40pm UTC](https://community.thunkable.com/t/offline-data-upload-labels-variables-looping/2931064/8 "2024-04-15T19:40:24Z")

</div>

Hi @ioannis

Is it possible to call the first and last entry from the offline db, to determine the elapsed time (last row timestamp - first row timestamp) with logic operation??

---

<div class="post-metadata">

### Author: ![nuuzonessqnzvv](https://avatars.discourse-cdn.com/v4/letter/n/bbce88/32.png) [@nuuzonessqnzvv](https://community.thunkable.com/u/nuuzonessqnzvv)
#### Post date: [April 15, 2024, 9:42pm UTC](https://community.thunkable.com/t/offline-data-upload-labels-variables-looping/2931064/9 "2024-04-15T21:42:05Z")

</div>

![Screenshot 2024-04-15 223814](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/a/4a219f4bd0d08725a2325ec343f55f6412f44161.png)  
I’ve attempted to create variables for the first and last timestamp. Then create the elapsed timestamp variable and display it in a label.

In the ‘find first occurrence’ and ‘find last occurrence’, i’m not sure what to put in place of the ‘b’.

Any ideas?

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [April 15, 2024, 10:15pm UTC](https://community.thunkable.com/t/offline-data-upload-labels-variables-looping/2931064/10 "2024-04-15T22:15:40Z")

</div>

You don’t need to use the `find first occurrence` block because you’re not searching for a value. Just get the _first_ list item and the _last_ list item using this block:

 ![3B54ADA9-E8A3-45FF-B44F-BACDB4FD0FFA](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/a/cacf39bbf08185d668458f5bddfe0b9e1e091627.png)

---

<div class="post-metadata">

### Author: ![nuuzonessqnzvv](https://avatars.discourse-cdn.com/v4/letter/n/bbce88/32.png) [@nuuzonessqnzvv](https://community.thunkable.com/u/nuuzonessqnzvv)
#### Post date: [April 26, 2024, 8:29am UTC](https://community.thunkable.com/t/offline-data-upload-labels-variables-looping/2931064/11 "2024-04-26T08:29:35Z")

</div>

Hi @tatiang

The timestamps being pulled from the local db are in the HH.MM.SS format. I’m presuming these are being pulled in as text, so I tried to convert them to a number by x1. The value for elapsedtimestamp =NaN right now.

 ![Screenshot 2024-04-26 092218](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/b/cb8e8dbae946e170e636d4f7fff09388995547f7.png)

How can i determine the elapsed time between the 1st and last timestamp?? I would like to have it also in the HH.MM.SS format.

Many thanks

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)
#### Post date: [July 25, 2024, 8:29am UTC](https://community.thunkable.com/t/offline-data-upload-labels-variables-looping/2931064/12 "2024-07-25T08:29:50Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
