web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Output in canevas comp...
Power Apps
Suggested Answer

Output in canevas compenent

(0) ShareShare
ReportReport
Posted on by 38
Hi
I have Powerapps Canevas, i have component with comboList, my component have intput and output variable and i have action; my combolist use the action for return collection, when i use in my application, my code there is no error; but my action doesn't retun the collection in my application, this is my code : 
 
Name of my component : Ordre_Jour_Banner
 
Variables of my components  : 
variable 1 :
 name : seanceCol
type : data
definition : input
type : table
 
variable  2 : 
 
 name : pointODJCol
type : data
definition : input
type : table
 
variable 3 : 
 
 name : oncochange
type : action
return data type : voide
 
 
 
and in Ordre.jour.banner.OnCochange i have this code : 
 
Set(getNewItem_seanceCM;LookUp(
    Ordre_Jour_Banner.seanceCol;
    Text(
        momentum_date_et_heure;
        "yyyy mmmm dd"
    ) = DropdownCanvas2.Selected.Value
));;

Set(Seanceid;getNewItem_seanceCM.momentum_seance_du_conseil_municipalid
);;



Set(type_sean_cm;getNewItem_seanceCM.momentum_type_de_seance_texte);;
Set(date_sean_cm;getNewItem_seanceCM.momentum_date_et_heure);;
Set(seance_cm;getNewItem_seanceCM.momentum_type_de_seance_texte);;

//chargement des nouveaux odj

ClearCollect(
    odj_cm_collection;
    Filter(
        Ordre_Jour_Banner.pointODJCol;
        'Séance du conseil municipal'.'Identifiant unique' = Seanceid
    )
);;
in my application when i chage the value of my combolist, my odj_cm_collection doesn't charge, my function doesn't return odj_cm_collection
thank you for response
Categories:
I have the same question (0)
  • Suggested answer
    Sunil Kumar Pashikanti Profile Picture
    2,318 Moderator on at
     
    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard