newId
  • 30 Oct 2020
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

newId

  • Dark
    Light
  • PDF

Article summary

Description

Creates and returns a new, globally unique identifier (GUID).


Input Parameters

NameTypeRequiredDescription
------------

Returns

Type: Text

Returns a new, globally unique identifier (GUID).


Examples

// generate and display a new, unique id in the debugger
var id = tools.newId();
debug.log(id);
// ai.suggest() requires a unique key as its 1st parameter
// we can use data.newId() to satisfy this requirement
ai.suggest(tools.newId(), "Testing", "Consider echo.");

Remarks

Programmers use unique identifiers all the time as a way to uniquely identify something. This function guarantees you will always receive a new, globally unique identifier (GUID) that won't collide with any other identifiers.

Use this function when you need a unique identifier for your own objects or are using another function that requires one.


What's Next