# Looking for a unique identifier of the user

**URL:** <https://community.thunkable.com/t/looking-for-a-unique-identifier-of-the-user/61861>\
**Category:** Questions about Thunkable X\
**Created:** [December 23, 2018, 11:07pm UTC](https://community.thunkable.com/t/looking-for-a-unique-identifier-of-the-user/61861 "2018-12-23T23:07:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Rogulla](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@Michael\_Rogulla](https://community.thunkable.com/u/Michael_Rogulla)\
**Post date:** [December 23, 2018, 11:07pm UTC](https://community.thunkable.com/t/looking-for-a-unique-identifier-of-the-user/61861/1 "2018-12-23T23:07:11Z")

</div>

Hello all,

I am looking for a way to get a unique identifier (ID), even without prior registration, in Thunkable X.

- in Thunkable Classic there is an extension for getting user’s name (I think it is made by puravida -\> TaifunAM = account management).

I would use this ID for example in storing values in an online DB. My app shall store some notes (text) from the user in firebase, and it is easy to distinguish the notes from other users by adding an ID to the key.

The EMail / Apple ID would be very nice, but for me it could be sufficient using another ID.

Thanks fpr your help!

---

<div class="post-metadata">

**Author:** ![darweeshworkqxl](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@darweeshworkqxl](https://community.thunkable.com/u/darweeshworkqxl)\
**Post date:** [June 14, 2021, 6:23pm UTC](https://community.thunkable.com/t/looking-for-a-unique-identifier-of-the-user/61861/2 "2021-06-14T18:23:41Z")

</div>

I am looking for something similar. But as a workaround you can generate a random number using the Math block, or if you are using Firebase you can use it straight away.

---

<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:** [June 14, 2021, 6:45pm UTC](https://community.thunkable.com/t/looking-for-a-unique-identifier-of-the-user/61861/3 "2021-06-14T18:45:55Z")

</div>

There is a nice little tool in Thunkable that, for certain, will give you a **unique ID**. It is the `clone or create` block in `Any Component`.

Whenever you clone or create a component, Thunkable assigns it a unique ID. You can use this ID as your user ID and then remove the component created/cloned.

---

<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:** [June 14, 2021, 6:50pm UTC](https://community.thunkable.com/t/looking-for-a-unique-identifier-of-the-user/61861/4 "2021-06-14T18:50:09Z")

</div>

Another way of getting a **unique ID** is to use a local storage DB. Every time you have a new user, create a new row in this DB and read the ID of the newly created row. You will get a unique ID that you can use for your user.

---

<div class="post-metadata">

**Author:** ![sketch](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sketch/32/109058_2.png) [@sketch](https://community.thunkable.com/u/sketch)\
**Post date:** [June 14, 2021, 7:47pm UTC](https://community.thunkable.com/t/looking-for-a-unique-identifier-of-the-user/61861/5 "2021-06-14T19:47:44Z")

</div>

Another one is to Use Firebase sign in and get the user ID.

---

<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:** [June 15, 2021, 4:02am UTC](https://community.thunkable.com/t/looking-for-a-unique-identifier-of-the-user/61861/6 "2021-06-15T04:02:41Z")

</div>

That’s what I do. But I also thought about joining the current date with the current time to create a unique user ID.

---

<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:** [June 15, 2021, 7:02am UTC](https://community.thunkable.com/t/looking-for-a-unique-identifier-of-the-user/61861/7 "2021-06-15T07:02:24Z")

</div>

@sketch yes you are right but the original post is asking for other means.

> [@Michael\_Rogulla](#):
>
> The EMail / Apple ID would be very nice, but for me it could be sufficient using another ID.

---

<div class="post-metadata">

**Author:** ![sketch](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sketch/32/109058_2.png) [@sketch](https://community.thunkable.com/u/sketch)\
**Post date:** [June 15, 2021, 7:16am UTC](https://community.thunkable.com/t/looking-for-a-unique-identifier-of-the-user/61861/8 "2021-06-15T07:16:46Z")

</div>

Oh haha .  
Then you can maybe Use a random math block.

---

<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:** [June 15, 2021, 7:33am UTC](https://community.thunkable.com/t/looking-for-a-unique-identifier-of-the-user/61861/9 "2021-06-15T07:33:29Z")

</div>

If you really want to generate a unique ID then use the web viewer and create the following JavaScript function.

```auto
function uuidv4() {
  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
    var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
    return v.toString(16);
  });
}

```

---

<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, 11:52am UTC](https://community.thunkable.com/t/looking-for-a-unique-identifier-of-the-user/61861/10 "2024-11-08T11:52:15Z")

</div>


