# Create standard format number

**URL:** <https://community.thunkable.com/t/create-standard-format-number/1289444>\
**Category:** Questions about Thunkable X\
**Tags:** question\
**Created:** [May 17, 2021, 4:30pm UTC](https://community.thunkable.com/t/create-standard-format-number/1289444 "2021-05-17T16:30:35Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![ozel1978](https://avatars.discourse-cdn.com/v4/letter/o/3ec8ea/32.png) [@ozel1978](https://community.thunkable.com/u/ozel1978)\
**Post date:** [May 17, 2021, 4:30pm UTC](https://community.thunkable.com/t/create-standard-format-number/1289444/1 "2021-05-17T16:30:35Z")

</div>

Hi All,

i need opinion on how to created standard format number with condition,

the number wont duplicate base on db either localdb, airtable or spreadsheet.

following block is ok but new session will duplicate the number or if system have multiple user it will duplicate also.

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

---

<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:** [May 17, 2021, 6:14pm UTC](https://community.thunkable.com/t/create-standard-format-number/1289444/2 "2021-05-17T18:14:45Z")

</div>

You can use the “seconds since 1970” block to create a unique number or text string. Or you can use Firebase sign-in to create a unique UserID. That’s what I’d recommend.

---

<div class="post-metadata">

**Author:** ![ozel1978](https://avatars.discourse-cdn.com/v4/letter/o/3ec8ea/32.png) [@ozel1978](https://community.thunkable.com/u/ozel1978)\
**Post date:** [May 18, 2021, 2:08am UTC](https://community.thunkable.com/t/create-standard-format-number/1289444/3 "2021-05-18T02:08:34Z")

</div>

Hi @tatiang

Thank you for your respond. i am not sure block “Seconds since 1970” relevant for my solution.  
i never use it before and from what i understand it related with timestamp?

---

<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:** [May 18, 2021, 2:14am UTC](https://community.thunkable.com/t/create-standard-format-number/1289444/4 "2021-05-18T02:14:11Z")

</div>

Yes, it’s a time stamp. Seconds since 1970 would give you a number like this:

1621304086

And then a second later:

1621304087

And so on… but always unique.

Can you give an example of a series of numbers that would work for you? And a series of numbers that would not?

---

<div class="post-metadata">

**Author:** ![ozel1978](https://avatars.discourse-cdn.com/v4/letter/o/3ec8ea/32.png) [@ozel1978](https://community.thunkable.com/u/ozel1978)\
**Post date:** [May 18, 2021, 2:21am UTC](https://community.thunkable.com/t/create-standard-format-number/1289444/5 "2021-05-18T02:21:18Z")

</div>

i only want to create set of number for example from 100-200. it need to follow standard formation not a random number. And most important is not duplicate even though it has multiple users who using the app. that why i though it need to compare at DB either localdb or airtable so the user will get free available formation number from the list.

---

<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:** [May 18, 2021, 3:46am UTC](https://community.thunkable.com/t/create-standard-format-number/1289444/6 "2021-05-18T03:46:39Z")

</div>

Okay so yes, you would need to check the existing data before assigning a new number to a user.

You can’t use a local database because you need other users on different devices (I assume) to also be assigned numbers.

So airtable could work. Create a new row for each new user but before assigning a number to them, check all rows to see if that number exists.

---

<div class="post-metadata">

**Author:** ![ozel1978](https://avatars.discourse-cdn.com/v4/letter/o/3ec8ea/32.png) [@ozel1978](https://community.thunkable.com/u/ozel1978)\
**Post date:** [May 18, 2021, 8:28am UTC](https://community.thunkable.com/t/create-standard-format-number/1289444/7 "2021-05-18T08:28:34Z")

</div>

@tatiang

how to bypass when it reach duplicate number? now i try on local db later i will create at airtable.  
in local db i already have record 1,2. total number i set to 10.  
if list variable i set to 3 then should be fine but imagine i have multiple user who create a number the sequence probably 1,3,5 then i believed it should by pass and get available number.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/2/62ec3e8653cd9064ec8cf5b448064b718dd17591.png)

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [May 18, 2021, 9:04am UTC](https://community.thunkable.com/t/create-standard-format-number/1289444/8 "2021-05-18T09:04:14Z")

</div>

Do exactly what you are doing in the else part of the block. [Change app variable list] by 1 to get the next number and check again.

Better to reorder your block to check only for none duplicates for example to go into a loop and use the [break] block if the number is not a duplicate.

---

<div class="post-metadata">

**Author:** ![ozel1978](https://avatars.discourse-cdn.com/v4/letter/o/3ec8ea/32.png) [@ozel1978](https://community.thunkable.com/u/ozel1978)\
**Post date:** [May 18, 2021, 9:49am UTC](https://community.thunkable.com/t/create-standard-format-number/1289444/9 "2021-05-18T09:49:05Z")

</div>

@muneer

first method: how to get next number and check again?  
second method: if possible to get sample from block because i never use looping or break block before.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [May 19, 2021, 11:06am UTC](https://community.thunkable.com/t/create-standard-format-number/1289444/10 "2021-05-19T11:06:51Z")

</div>

See this example  
[https://x.thunkable.com/projectPage/60a4e8623fb2e80012cea340](https://x.thunkable.com/projectPage/60a4e8623fb2e80012cea340)

It will check for the next available number in a given range and it will also check if no more numbers are available.

You can check for next available numbers many times and once you decide to reserve the number it will be added to the list of reserved number so next time you check for available numbers the number added will not show as an available number.

---

<div class="post-metadata">

**Author:** ![ozel1978](https://avatars.discourse-cdn.com/v4/letter/o/3ec8ea/32.png) [@ozel1978](https://community.thunkable.com/u/ozel1978)\
**Post date:** [May 19, 2021, 3:50pm UTC](https://community.thunkable.com/t/create-standard-format-number/1289444/11 "2021-05-19T15:50:01Z")

</div>

HI @muneer

i got this message when click on link given. probably is not public yet?

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/e/1e28f7080ef89c8cff3e930a6c0b56b77ac03892.png)

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [May 19, 2021, 3:52pm UTC](https://community.thunkable.com/t/create-standard-format-number/1289444/12 "2021-05-19T15:52:10Z")

</div>

Here is the link again. It is public

[https://x.thunkable.com/projectPage/60a4e8623fb2e80012cea340](https://x.thunkable.com/projectPage/60a4e8623fb2e80012cea340)

---

<div class="post-metadata">

**Author:** ![ozel1978](https://avatars.discourse-cdn.com/v4/letter/o/3ec8ea/32.png) [@ozel1978](https://community.thunkable.com/u/ozel1978)\
**Post date:** [May 19, 2021, 3:59pm UTC](https://community.thunkable.com/t/create-standard-format-number/1289444/13 "2021-05-19T15:59:00Z")

</div>

thank you muneer. appreciated you help. seem a bit complex but let me study and try to apply from my existing block.

---

<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:** [November 8, 2024, 1:22pm UTC](https://community.thunkable.com/t/create-standard-format-number/1289444/14 "2024-11-08T13:22:27Z")

</div>


