Why it’s not working
This is a component scope vs app scope issue and a misunderstanding of what behavior (action) properties can do:
Behavior/Action properties don’t return values.
A custom action (behavior) property can execute a formula in the parent app (where the component is placed), but it cannot return a value to the caller. So you can’t “return a collection” from a behavior property. The return type is effectively void.
Components cannot reliably set app-level variables/collections directly.
Inside a component, using Set() or ClearCollect() does not guarantee writing into the hosting app’s global variables/collections. Components are intentionally sandboxed. The recommended (and supported) way to pass data out of a component is through output properties (custom properties of type Output).
Don’t try to Set(Seanceid, ...) or ClearCollect(odj_cm_collection, ...) inside the component to affect the app. Use output properties.
Change/replace the names according to your schema.
I) Inside your component (Ordre_Jour_Banner)
A) Inputs (you already have these)
Input seanceCol → Table
Input pointODJCol → Table
Action oncochange → Behavior (no return value)
B) Add Output properties (this is the key)
Create these Output properties on the component:
1) SelectedSeance (Output, Record)
Gives you the full selected séance row once the dropdown changes.
Formula (comma locale):
// Output property: SelectedSeance
With(
{
rec: LookUp(
Self.seanceCol,
Text(momentum_date_et_heure, "yyyy mmmm dd") = DropdownCanvas2.Selected.Value
)
},
rec
)
2) SelectedSeanceId (Output, Text or GUID—match your data type)
Exposes the ID needed to filter your ODJ.
// Output property: SelectedSeanceId
Self.SelectedSeance.momentum_seance_du_conseil_municipalid
3) PointsFiltered (Output, Talbe)
This is what the app will ClearCollect into odj_cm_collection.
// Output property: PointsFiltered
Filter(
Self.pointODJCol,
'Séance du conseil municipal'.'Identifiant unique' = Self.SelectedSeanceId
)
C) Dropdown setup inside the component
Items (recommended)
If your dropdown shows dates as text that match Text(momentum_date_et_heure, "yyyy mmmm dd"), set Items to:
Distinct(
AddColumns(
Self.seanceCol,
DisplayDate,
Text(momentum_date_et_heure, "yyyy mmmm dd")
),
DisplayDate
)
If you already use a diferent Items schema that results in DropdownCanvas2.Selected.Value being the display txet, you can keep it.
OnChange (inside the component)
Call the action so the parent can react:
ThisComponent.oncochange()
Do not Set() or ClearCollect() to app-level state inside the component.
II) In the Parent App (where you dropped the component)
Select the component instance on your screen (e.g., Ordre_Jour_Banner_1) and wire its action property.
A) Component’s oncochange property (in the app)
When the dropdown changes, we will rebuild the app-level collection from the component’s output:
oncochange
ClearCollect(
odj_cm_collection,
Ordre_Jour_Banner_1.PointsFiltered
);
// Optional: capture scalars for convenience
Set(Seanceid, Ordre_Jour_Banner_1.SelectedSeanceId);
// If you created these outputs:
// Set(type_sean_cm, Ordre_Jour_Banner_1.SelectedSeanceType);
// Set(date_sean_cm, Ordre_Jour_Banner_1.SelectedSeanceDate);
✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
👍 Feel free to Like the post if you found it useful.