Start a new topic

Use LOV Chips Selector in Forms for a manual (dynamic) LOV attribute

Usecase: For a new model we are building, our business has a need to enforce a mulitple choice attribute from a LOV. 


When defining a new attribute on an entity, selecting a 'LOV' attribute data type allows for the "mulit valued" with a "value separator" (delimiter) configuration. When using this configuration in an entity Form, I am able to use a 'Chips' component type and I can choose 1 or many values that become a delimited string for this attribute from the defined LOV list on the model.


I am trying to accomplish this same configuration but with a dynamic LOV. 


Our business users manage 'business terms' that are subject to change (renaming or adding additional terms) and many business terms can belong to an entity if it aligns with more than one business unit. To solve for this dynamic LOV, we have built it's own entity: listOfValues, with schema: listId, listName, listValue. We have also written a custom database function that returns all of the listValues for a specific list in the listOfValues entity so it can be called via SemQL to render as the menu items for this component.


The issue is that since the LOV is dynamically fetched on render, the LOV can not be used as the attribute data type as mentioned above. The only solution I can find is to use "String" data type which does not support "multi valued" or "value separator" and in turn, will not support us selecting multiple values from our rendered LOV list. (The 'String' data type does allow us to use the Menu selector component to select one value from our LOV but not multiple.)


We need to be able to select multiple values from our dynamic LOV to store as the value for this new attribute at a minimum. 

An added bonus would be if we can select the mulitple values through the 'Chips' component type as we can do for the predefined LOV lists used as data types.


Is there currently any way to achieve this functionality in xDM? 

We are currently running version 2025.1.

1 Comment

Garrett,

As you’ve noticed, LOVs are design-time constructs. Your business requirement, however, is to create new values at runtime. The proper way to address this is by using a referenced entity rather than a LOV.

From your description, it also sounds like this entity should support a many-to-many (multi-valued) relationship. To achieve this with referenced entities, you’ll need to introduce a bridge table. An example structure is shown below. Once implemented, xDM provides a many-to-many Stepper UI for working with these relationships. You can find the relevant documentation [here].


Example Model

EntityA - PK_EntityA - Attr1 - Attr2 - ... EntityB - PK_EntityB - Attr1 - Attr2 - ... BridgeEntityAEntityB - PK_BridgeEntityAEntityB - FK_EntityA - FK_EntityB

 

This approach ensures flexibility for runtime value creation and proper handling of multi-valued relationships.


1 person likes this
Login to post a comment