We’re developing a generic pivot table custom widget that ideally works with any object type (Guide to come
). We’ve successfully implemented dynamic querying and JSON config-based aggregation that works (in theory) across object types, as well as saving configurations like the row, column and keyfigure as JSONs in separate view object types for allowing true user customization and quickly switching between views ![]()
Sneek-Peak:
While the dynamic configuration works excellent, we are encountering fundamental limitations the interface and metadata retrieval of the custom widgets input parameters:
- How to identify which object type is actually bound to an objectSet input parameter of the custom widget?
- How to configure a custom widget to be truly object-type agnostic
Question 1: How to Identify the Actual Object Type of a Bound Object Set?
The Problem
When an objectSet parameter is defined with an objectType in the widget config, we cannot determine what object type is actually bound at runtime (or if any at all). The metadata we receive always reflects the config-defined type, not the bound type.
Configuration Example
Apply
// In pivotTable.config.ts
parameters: {
inputData: {
type: “objectSet”,
objectType: MyConfiguredObjectType, // ← Config specifies this type
displayName: “Object Set (Input)”
}
}
Observed Behavior
Scenario: User binds a DIFFERENT object type (e.g., MyOTHEROTHERObjectType) to the parameter in Workshop
What happens:
Widget receives parameters.values.inputData with an object set
Extract definition: objectSet.$objectSetInternals.def
Fetch metadata: client.fetchMetadata(objectTypeDefinition)
Metadata returned: Properties of MyConfiguredObjectType(the config type)
Metadata NOT returned: Properties of MyOTHEROTHERObjectType(the actual bound type)
Log evidence:
[DEBUG] Found objectTypeDefinition: {
type: ‘object’,
apiName: ‘MyConfiguredObjectType’ // ← Always the config type!
}
[SETUP] Loaded properties for object type: 150
✓ Property names sample: [‘… …]
// ← These are properties of MyConfiguredObjectType, not the bound object type
What We Need
A way to determine the actual object type of the object set bound to the parameter at runtime
Access to the metadata/properties of that actual bound object type, not the config-defined type
What We’ve Tried
Checking objectSet.$objectSetInternals.def.apiName → Returns config type
Checking objectSet.$objectSetInternals.def properties → Points to config type
Calling client.fetchMetadata(objectTypeDefinition) → Returns config type metadata
(I am sure there is more I have tried, just can remember in the bazillion of approaches
)
Having that said, the general question 2 is: How to Configure a Custom Widget to Be Object-Type Agnostic? Custom widgets are nice, but if I have to create a new config and adjust the SDK with every new object type, it is quite not as flexibel as i hoped it to be ![]()
The Problem:
The objectType field in the objectSet parameter configuration forces Workshop to work only with that specific type and auto-create default temporary object sets.
What We’ve Tried:
Attempt 1: Use Ontology Interfaces
We attempted to use a common interface that multiple object types implement:
parameters: {
inputData: {
type: “objectSet”,
objectType: MyCommonInterface, // ← Tried using an interface
displayName: “Object Set (Input)”
}
}
Result:
Interfaces are not supported by custom widgets (OSDK generation fails or widget SDK doesn’t recognize interface types)
Attempt 2: Use Dummy Object Type Pattern
Use a special “dummy” object type in the config, detect it at runtime:
// Config
objectType: ThisIsTheDummyObjecType// Runtime detection
if (objectTypeApiName === “ThisIsTheDummyObjecType”) {
// No real object set bound
}
[DEBUG] Found objectTypeDefinition: {
type: ‘object’,
apiName: ‘MyConfiguredObjectType’ // ← Always the config type!
Attempt 3: Leave type definition of objectSet config completely blank.
parameters: {
inputData: {
type: “objectSet”,
/// objectType: MyConfiguredObjectType, // ← No objectType specified!
displayName: “Object Set (Input)”
}
}
Result
: objectType is mandatory field for input parameter of tpe objectSet.
#######
So yeah, I am starting to run out of ideas… any idea or guidance is highly appreciated!
Again my specific Questions:
- How do we access the actual object type of the object set bound to a parameter at runtime (not the config-defined type)?
- How can we detect when an objectSet parameter is truly unbound (field empty in Workshop) vs. bound with Workshop’s auto-created default temporary object set?
- Is there a way to define an objectSet parameter without specifying a concrete objectType, allowing any object type to be bound?
- Is there a recommended pattern for building generic/reusable widgets that work with multiple object types? Will Interfaces support this functionality in future?
Best P



