Sequential Integer (Feature Requested on GitHub)

I have posted this as a Feature Request on GitHub, but would be interested in hearing other feedback or workarounds here

I would like a Sequential Integer block like the Random Integer Block in Math
Screenshot 2021-02-20 165530

The reason is to assist the use of Buckets in Firebase. When Creating Buckets on firebase, I need a way to access sequential buckets. If I create a Bucket with text I can have individualized buckets, but cannot access those buckets on another screen as the key is linked to specific text on the other page. (See 2 Below)
Screenshot 2021-02-20 170006
Screenshot 2021-02-20 170117

As I cannot access unique text from one page on another (saving as a Stored or App Var would have the information not accessible on multiple devices) I tried to use the Random Integer from x-x Block. This gets part way there it saves as a bucket within a bucket AND allows me to access the information on a different screen. The issue is the number selection is random. As such I can only access the data by knowing the random value selected. (See 4 Below)
Screenshot 2021-02-20 170803
Screenshot 2021-02-20 170834
Screenshot 2021-02-20 170947
Screenshot 2021-02-20 171205

Firebase does not like the Seconds Since 1970 block so I cannot attempt that. I think that if I could set a Sequential Integer from x-x block, I could set the key on the other page to expect a sequential set of values and access buckets within buckets. The randomness of the Random Integer Block makes that difficult unless I know the random number chosen.

If you use the cloud variable blocks with the list blocks, you’ll achieve what you’re going for. Thunkable handles the incremental numbering of the collection name (field names).

@drted has posted on this in the past. Do some searching and you’ll surely find the threads.

If I use the Cloud Var I can’t set the Key how I want. I use the RTDB Block so I can set buckets within buckets

You can tho!

Here using 1 cloud variable I have many different buckets.

Forget - main bucket

UserID - sub bucket of forget

Crossoff, date, note - all subbuckets found in each userID sub bucket and each is a list of objects.

An example of what this could look like on FB using only a single cloud variable follong the idea above

The numbering is maintained by thunkable. Big IF here tho. iF you delete a numbered node, your list won’t work anymore. Instead, add a property to each terminal node called deleted:no

When you delete a value, you’ll actually only switch deleted to :yes and filter any result whose property of deleted = true

1 Like

I will give it a shot. For some reason i can never get the Cloud Var to work, but I will try it out

Okay, I am having a hard time getting thunkable to set numbering. I have it set up as

But on Firebase it just replaces the Note bucket each time instead numbering…

Use list blocks. Check this thread for an idea

In list => yourCloudVariable => insert last as => your object

Here’s a project link
https://x.thunkable.com/projectPage/5e5c91ca5d0aa012e56848bd

I had tried that but once I add a cloud Var to list it stops saving if I set this up


Then it won’t save to RTDB and nothing happens.

When I do like this, is does save to RTDB but not sequentially

Even if using the list method, I just try to save anything it doesn’t upload to RTDB

Do you initialize the /Note bucket as an empty list.

Check if that bucket is null. If null, set it as an empty list

I do this when the user signs in