Skip to content

Entity

The Entity data type in Monkedo brings related data fields together into one structured item, known as an Entity. Each entity consists of field-value pairs, where each field has a specific value. This makes entities perfect for representing records, such as details about a person, product, or project. For example, a person entity might have fields like "firstname," "lastname," "age," and "lucky number," each with their respective values as shown below.

entity example

Entity fields can contain any characters such as lower and upper case, numbers, spaces, and special characters. For example, all of these are valid Entity field names: "fullname", "fullName", "Full Name", "fulname 2", "full_name".

Entities are frequently used when working with data from applications, as most records are structured in this way. However, there are no fixed fields within entities; they adapt based on the app or component that created them, with specific fields and values dependent on the automation’s context. Monkedo allows users to inspect entity details in the Info Panel, including field types and values as shown in the example above. Entities may contain any number of fields—or none at all, in which case they are considered Empty Entities.

To manipulate entities, Monkedo provides several components under the Action > Entity category. These allow you to create, modify, and manage entity data for your automations.

The Create Entity component lets users create a custom entity by specifying fields, their types, and values. If no fields are specified, the output will be an Empty Entity. For example, you could create an entity with fields like "Name" and "Weight" to describe a fruit, such as a banana.

Create Entity component

This component outputs the following entity:

Banana entity example

The Get Entity Field component retrieves a specific field’s value from an entity. For instance, to access the "Name" field of the banana entity, you can connect this component to extract that specific detail.

Get entity field
Get Entity Field component. "Name" field will be extracted.

The component outputs only the selected field's value as shown below.

get entity field value

This component is useful when you want to provide an entity field's value as the input of another component instead of the entire entity.

The Set Entity Field component assigns or updates a field within an entity. If the entity or field doesn’t exist, they are created. For instance, you can set the "Weight" of a banana entity to update the entity’s data. Both the field name and value can be constants or provided dynamically from the automation flow.

Set Entity Field component

The result of this component is a new entity with the updated data.

set entity field value

The Delete Entity Field component removes a specified field from an entity, resulting in a new entity that excludes this field. For example, removing the "Weight" field from a banana entity returns an entity without this information.

banana without weight

The Merge Entities component combines two entity values into a single entity. If both entities contain the same fields, the values from the second entity will overwrite those in the first, so the resulting entity prioritizes values from the second entity wherever there’s overlap.

This component is ideal for merging data from multiple sources. In addition to this, it’s useful in scenarios where you need to set default or missing fields in an entity. Suppose you manage information about products in a store, and each product needs fields like "Shelf Life," "Days In Stock," and "Stock Amount." These fields can be initialized with default values by setting them up in the first input (Entity 1), while specific details about a product, such as a banana, are provided as the second input (Entity 2) as shown below.

Merge entity with default produce details

When the merge operation is performed, the resulting entity includes all fields from both inputs. If a field is missing in the actual product entity (the banana entity), it will inherit the field from the default entity. If the actual product entity has a value for a field, that value remains unchanged in the resulting entity.

merged banana entity

This allows the merge operation to retain all existing fields in the actual entity while filling in any missing fields from the default entity.

Other entity components are available in Monkedo to further extend functionality and can be found in the editor under Action > Entity.

To easily access specific fields within an entity for use in another component, Monkedo provides Access Expressions. Hovering over a component input makes the "+Expression" button visible.

Expression button

Clicking the "+Expression" button reveals the Expression Box and you can open the expression type selection menu by clicking the blue link as shown below. Here you can select the Access expression if it is not already selected.

Expression Types
Expression Types

By connecting an entity value to this input, all fields of that entity will be displayed in the expression box (when you click the expression box), allowing you to choose the required field directly.

banana entity in access expression menu
"Name" field is selected from an entity provided to a component input through a diagram connection

This approach simplifies workflows by eliminating the need for additional components to access individual fields.