Hi!
I have a shared component with a coded component inside. When it was originally created, it had no data or actions, but we’d like to add some now. This doesn’t seem to be possible – when selecting Data Source, all options are disabled.
The same behaviour occurs when adding a new coded component to an existing shared component. However, if data was passed to the coded component before it was turned into a shared component, everything works as expected.
This is actually by design, shared components work with "component params" rather than direct data source bindings. Instead of passing a data source directly, you set up component params (for the data types, values, or object class references you need), and then bind those params inside the component — including inside a Coded Component via its Data section.
If your component already has data bindings when you share it, Create will warn you and offer to automatically generate component params from those bindings, which makes the transition smooth. (View the attached image) However, if the component doesn’t have any pre-existing bindings — as in your case — that prompt doesn’t appear, and the path forward isn’t as obvious. I can see how that’s confusing!
I don’t see how that’s by design – adding more or different data sources works fine as long as you already had one data source added in the coded component on shared component creation.
Turning data bindings into params is an option, not a requirement. Pre-existing bindings work just fine without being converted to params, as long as the component isn’t shared between apps.
Similarly, if I add a Text component (or any other component) to an existing shared component, I can still bind it freely to any data source within the app.
I want to make sure I’m understanding your question correctly, as there’s an important distinction between a Component and a Shared Component (shared between apps).
To clarify my earlier answer: converting data bindings to params is an option available on a regular Component, like you mention, but this is not on a Shared Component. So when you say you’re not able to select a data source when adding data to the Coded Component — is this happening inside a component that is shared between apps?
Also, could you let us know which version you’re on? That’ll help us investigate further if needed.
It used to be called Shareable component both both variants at some point, but I suppose it’s called Component now, sorry about the confusion. The component in screenshots is not shared between apps.