Types

Boolean

Use the wire.toBoolean function to determine if a value of any type is truthy. Use the second parameter to return a default if the value passed in is not able to be evaluated.
The following example sets the bool variable to truebecause the string "true" will evaluate to true.
1
const bool = wire.toBoolean("true", false);
Copied!
The following example also sets the bool variable to true because the value null passed in cannot be evaluated as a proper Boolean. The function defaults to the second parameter true. If the second parameter was not passed in, the function would return false.
1
const bool = wire.toBoolean(null, true);
Copied!

Numeric

To determine whether a value of any type is a number, use the wire.inNumeric function.
1
const number = wire.isNumeric("1234");
Copied!

Guid

To create a universal unique identifier, use the wire.guid class.
1
const id = wire.guid();
2
3
// id = f09a1e51-7dbf-49c2-b252-ff16c3b42a7a
Copied!
Copy link