Skip to content

Creating a document id or UUID

Sometimes you will need to generate a documentId when creating documents from rulesets, components, and web services.

There is a built-in function for generating UUIDs

To generate a UUID in client rules and components you can call crypto.randomUUID() ex:

const documentId = crypto.randomUUID();

To generate a UUID in server rules and webservices you need to import the node:crypto library ex:

const crypto = require('node:crypto');
const documentId = crypto.randomUUID();

Note: The node:crypto library is not available for Formbird Version 3.1.x below(AngularJS). However this is available for client rules and components.