Device ID - Where is it stored? How do I reference it?

In reference to the CONTEXT documentation below, where is the UUID stored and how do I reference it?

I have a use case where warehouse operators are all entering unload data on a single iPad. Weโ€™d like to give operators a listing of trucks unloaded at that device only so they can adjust their trucks only if needed.

A million thanks

0 9 3,124
9 REPLIES 9

Bahbus
Participant V

Itโ€™s not really โ€œstoredโ€ anywhere. Depending on the exact version of UUID implemented (there are 5 versions and then a couple variants) in AppSheet (probably version 3 or 5), it is basically a special mathematical formula based off of device unique identifiers like MAC addresses, or something similar.

Either way, itโ€™s up to you to store the value if you need it. CONTEXT(โ€œDeviceโ€) is the only way to get it.

GreenFlux
Participant V

CONTEXT("Device") is not actually consistent per โ€˜deviceโ€™.

  • Each browser reports a different DeviceID (Desktop or Mobile)
  • A different DeviceID is returned for each Private Browsing/Incognito session, on top of the normal one for each browser/device
  • Native app DeviceID (Mobile Only) is different from Browser IDs on that device
  • Native app DeviceID (Mobile Only) may change with re-install of app

In other words, a single mobile device with the native app and a few browsers (plus private sessions), could have 5-10 IDs.


If you already have a User table, consider adding a [Devices] EnumList to store that userโ€™s DeviceIDs.

Or add a Device table to store a [Name/Location/SerialNum] to go with each [DeviceID].


[EDIT]

Think of the specific app like an Excel file.

CONTEXT("Device") is asking what you are using to open the file, such as Office365/Chrome, or Windows10/Office2016. There are lots of ways to open the same app on the same device.

Wait what!?
For real?!

I tested it when the feature first came out, using multiple browsers on macOS and iOS. I did not try on android.

There may be more consistency between the OS and chrome browser on android.

To clarify, CONTEXT("Device") does NOT provide the deviceโ€™s hardware UUID; it returns a random UUID AppSheet itself generates.

The native appโ€™s UUID is generated when the app is installed and will change if the app is reinstalled.

The browser appโ€™s UUID is generated on the browser appโ€™s first run and is attached to the browserโ€™s data store. The browser appโ€™s UUID will change if the data store is deleted (cache cleared?).

Hi Steve, the key is whether the UUID stays the same and can consistently represent the device. Outside of the reinstallation, will the UUID stay the same for the mobile device? I understand the browser is more of a session id.

It should, to the extent AppSheet itself wonโ€™t modify it. I donโ€™t know whether the app UUID is the same for all user profiles of the device, though. I also suspect that each white labeled app installation gets its own UUID.

I have 4 different browsers installed in my laptop:

  • Chrome
  • Edge
  • Tor
  • Firefox

When you launch the app separately in each one of browsers, the returned value of CONTEXT(โ€œDeviceโ€) changes. It also changes when you launch the app in your mobile device thru AppSheet App and/or any one of the installed mobile browsers. It might be pretty straightforward and fantactic provided that the CONTEXT(โ€œDeviceโ€) could be able to return the deviceโ€™s MAC address.

Soโ€ฆ CONTEXT(โ€œDeviceโ€) is pretty useless then?
What can the use case possibly be for having a โ€œdevice idโ€ that can and will changeโ€ฆ

Top Labels in this Space