Skip to content
Stand with Ukraine flag

Update shared location attribute

  • Widget
  • v1.0.0
  • Sep 1, 2026
  • MIT license
  • v4.2+ | Built-in
Update shared location attribute

Simple form to input new location for pre-defined shared attribute key.

Widget Type
  • Latest
Category
  • Input Forms

Who it’s for

Anyone who needs to give a device a position rather than record one — a geofence center a tracker checks itself against, a home location a device compares against, a target the firmware navigates toward. The coordinates are configuration the device consumes.

What it does

The Update shared location attribute widget presents latitude and longitude fields and writes them to the entity on save. The Get current location button fills both fields from the browser’s own geolocation, which is what makes this practical for a technician standing at the spot with a phone.

  • Two fields, one action — coordinates entered or captured together and committed as a pair.
  • The current location button removes the transcription step, which is where manual coordinate entry usually goes wrong.
  • High accuracy mode can be requested from the browser, trading battery and time for a better fix.
  • The key names are configurable, so the widget writes whatever the rest of the dashboard already reads.
  • Field labels, their wording, and whether each is required are all configurable.
  • Fields lay out in a column or a row, so the form fits a narrow panel or a wide band.
  • Stored in shared scope, the coordinates reach the device on its next connection, which is what makes them usable by firmware rather than only by dashboards.
  • The Update shared location attribute widget captures a position: it draws no map, so pairing it with a map widget is what lets anyone confirm the point landed where they meant.

How to set up

Data keys

The Update shared location attribute widget writes the two keys named in its settings.

AttributeScopeOperationDescription
latitudeSharedRead + WriteThe latitude key, named by Latitude key name. Written as attribute.
longitudeSharedRead + WriteThe longitude key, named by Longitude key name. Written as attribute.

Set the key names to match whatever the map widgets on the dashboard already read. The defaults are latitude and longitude, and a mismatch produces a form that saves successfully while the map stays empty.

Form

SettingDefaultEffect
Latitude key namelatitudeThe key written for latitude
Longitude key namelongitudeThe key written for longitude
Show button ‘Get current location’OnFills both fields from the browser’s geolocation
Use high accuracyOffRequests a more precise fix, at the cost of time and battery
Show labelOnPrints the field captions
Input fields alignmentColumnStacks the fields or places them side by side
Latitude field requiredOnBlocks saving without a latitude
Longitude field requiredOnBlocks saving without a longitude
Show result messageOnConfirms the write on screen

How to customize

  • To match the dashboard’s existing keys — set the Latitude key name and Longitude key name.
  • To get a better fix in the field — turn on Use high accuracy, which is worth the wait when the position is being surveyed.
  • To fit a wide band — set Input fields alignment to Row.
  • To word the fields — set the Label for latitude and Label for longitude, or turn labels off on a compact panel.
  • To allow a partial entry — turn off the required flags, though a half-set position is rarely useful.
  • To word the validation — set the ‘Required’ error message to something that says what is missing.

Tips

  • Use shared scope only when firmware actually reads the coordinates. If nothing on the device consumes them, server scope does the same job without adding a value the device has to download and store.
  • Put a map beside the form showing the same keys. A pair of coordinates is unverifiable by reading it, and a point that landed in the wrong hemisphere because of a sign is obvious on a map and invisible in a text field.

Share Your Widget with the Community

Built a custom widget? Export it as a JSON from ThingsBoard and publish it to the IoT Hub through a simple 4-step wizard (Upload, Listing, Readme, Review & Submit). Share it with thousands of ThingsBoard developers worldwide and get featured in the catalog.