Map Entity Attribute

Map Entity Attribute

Kuika's MapEntityAttribute action is used to establish a relationship between an entity and a single attribute. This relationship allows attributes defined in the system to be linked to the desired entity, and the form or data structure is shaped accordingly. This action enables flexible definition of customisable data fields in the EAV data model. It is one of the building blocks of dynamic form creation processes.

This action is currently available in beta version and is still under development. It is recommended to test it carefully before using it in a production environment.

Technical Features 

  • Attribute Mapping (EAV Panel): The MapEntityAttribute action works with the following parameters:
    • EntityId (Guid – Required): The unique ID of the entity to which the attribute will be linked.
    • AttributeId (Guid – Required): The ID of the attribute to be mapped to the entity. This action supports mapping only one attribute at a time.
    • SortOrder (Integer – Optional): An optional sequence number that specifies the order in which the attribute will be displayed in the form.
  • Data Source Compatibility: All parameters can be retrieved from the following sources via the Symbol Picker:
    • EntityId / AttributeId: Dynamic Form, Select Box, Action Result, Fixed
    • SortOrder: Fixed or user input as Component
  • Web & Mobile Application Support: The MapEntityAttribute action works in both web and mobile applications.
Map Entity Attribute Action Application Steps

1. Field Selection on the UI

  • The user is presented with a field where they can select an entity.
  • Then, the attributes defined in the system are listed.
  • Even if multiple attributes are selected, the MapEntityAttribute action only works for a single attribute. Therefore, the action must be triggered separately for each selected attribute.

2. Action Definition

Add the following action to the ‘Add Attribute’ or ‘Match Fields’ button:

  • + ADD ACTION > OnClick > EAV > Entity Attributes > MapEntityAttribute

The parameters are configured as follows:

  • EntityId: Symbol Picker > Select Box / Dynamic Form
  • AttributeId: Symbol Picker > Select Box
  • SortOrder: Symbol Picker > Optional > Fixed / Numeric Input

3. Using the Action Result

  • After the match is complete, a notification can be displayed to the user (Show Toast).
  • The GetEntityAttributes action can be run for the relevant entity to display the new attributes.
Use Case: Adding Dynamic Fields in a CRM Application

In a CRM application, the user wants to add fields such as ‘Date of Birth’ and ‘Customer Notes’ to customer cards.

  • The user selects the relevant customer entity.
  • Selects one of the attributes defined in the system.
  • When the ‘Add Field’ button is clicked, the MapEntityAttribute action is executed.
  • The selected attribute is linked to the relevant entity.
  • The Dynamic Form is recreated according to this new attribute.
  • This process is repeated for each attribute.

Map Entity Attribute Action Advanced Customisations
  • Add Attribute One by One: The action works for only one attribute at a time. If multiple additions are desired, the MapEntityAttribute action must be triggered one by one with a loop after selection.
  • Conditional SortOrder Assignment: The SortOrder value can be dynamically determined based on the attribute type.
  • Preview: A form preview can be presented to the user before the attribute is added.

Technical Risks

  • Invalid IDs: If EntityId or AttributeId is missing or incorrect, the mapping will fail.
  • Duplicate Mappings: If the same attribute has already been mapped to the same entity, the system may throw a conflict or ignore the mapping.
  • Order Conflict: If the same SortOrder is assigned to different attributes, unexpected sorting errors may occur in the UI.

The MapEntityAttribute action is one of the fundamental building blocks of Kuika's EAV-based architecture, enabling flexible field definitions for entities. It is ideal for creating customisable data models and developing user-specific forms.

Other Related Content

No items found.

Glossary

No items found.

Alt Başlıklar