Attribute Selectors

Parent Previous Next

Attribute selectors


Attribute selectors allow you to retrieve an object value or property from the currently scoped object, or a relative thereof. There are five attribute selectors available - @ObjectName, @ObjectPath, @ObjectType, @PropertyValue(<propertyKey>), @PropertyType(<propertyKey>).


Syntax


<AttributeSelector> [ ObjectSelector ]



Arguments

ObjectSelector - This is specified as .From(<objectSelector>) and allows you to retrieve the specified attribute from a related object.


Returns

Selector

Returns

@ObjectName

The name of the object.

@ObjectPath

The path of the object within the carbon tree.

@ObjectType

The type of the object

@PropertyValue(<propertyKey>)

The value of the property specified by <propertyKey>.

@PropertyType(<propertyKey>)

The type of the property specified by <propertyKey>,


Examples

Creates a span with the name of the current object:


Span(@ObjectName);



Creates a span with the value of the property ‘Description’ from the current object:


Span(@PropertyValue(‘Description’));



Creates a span with the value of the property ‘Description’ from a child object named ‘Details’:


Span(@PropertyValue(‘Description’).From($Object(Path:’Details’)));