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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Communication between ...
Power Apps
Unanswered

Communication between two PCF controls

(0) ShareShare
ReportReport
Posted on by 2

Hi everyone,

Hope all doing well. I just need to know if there is any way to pass data and trigger one PCF control from other PCF control. Let say, we have one PCF control containing dropdown List and other PCF showing details related to the selection in 1st PCF. When user select from dropdown in 1st PCF control ,it will run some business logic and show the results in 2nd PCF control.

I mean, if there is any way to achieve this? 

@ScottDurow (superman) 🙂

 

Thanks

I have the same question (0)
  • david_rivard Profile Picture
    42 on at

    Hi @MHammad , I don't know if this will answer your question completely, but your 2 PCF are bound to fields on the form they can communicate with each other natively.

    In fact, they don't have to know each other at all the magic happens in how the properties are defined in the manifest of the PCF and to what field you bind your properties on the form.

    EX.

    PCF 1 = Color Picker, bound to a text field that will store the output of the color picker 

    PCF 2 = Sparline control, bound to the same field. (defines the color of the sparkline)

    When the output of the Color Picker changes, the color of the sparkline is updated in real-time

    sparkline.gif

     

    For sure the same can be applied to your use case.

     

     

     

  • Ben Thompson Profile Picture
    1,400 on at

    As @drivard points out if you bind two columns (note new terminology)  to your PCF component as the parent column is updated (in the other control) the page will pass the change to your main PCF component while triggering the updateView event and you can then run your business logic on the newly updated value.

     

    As an aside, If you business logic is time consuming (even if it's just a few lines of code) I find it useful to keep an internal version of the parent value and only run the business logic after confirming that the parent value has really changed - there are a lot of other reasons why updateView can be called - a value change is one of the rarer events.

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    Hi @MHammad , 

     

    In case you can rely on common attributes, the approach from @drivard and @ben-thompson is the best.

    In case you need to catch a click an raise some kind of event for the first PCF, and only on this event the second PCF should get noticed, I'm not sure if  you can filter the changing of attribute values the right way, because I'm afraid that the second control will be triggered also when the first updateView is called (you cannot know that the value is really changed, or is it because of control initialization).

    Custom Events for PCFs in on the roadmap (no idea when), but until then maybe my blog about using postMessage to communicate between PCFs might help: https://dianabirkelbach.wordpress.com/2020/05/15/can-pcfs-communicate/

    Kind regards,

    Diana

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 386 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 321

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 311 Super User 2025 Season 2

Last 30 days Overall leaderboard