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 / Change bound field value
Power Apps
Answered

Change bound field value

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hey Guys!

Maybe i'm just to unexperienced to solve this issue but in the documentation of Manifest schema reference on https://docs.microsoft.com/en-us/powerapps/developer/component-framework/manifest-schema-reference/property#remarks it says that bound properties can be changed. To be precise it says: "an entity attribute that the component can change (bound) or read-only values (input)".

So from my understanding it should be possible and intendened to update the value of a CRM field that has a custom control on top of it.

I created a custom control for a two option set. Instead of the normal Yes/No thing it should show a star image. This star turns yellow for true and white for false.

So far I got everything working BUT my problem is, that even when I execute 

this._context.parameters.<parameterName>.raw = true; the underlying field does not get changed.
I am googling my *** of for two days now but I only find solutions where the creator uses Xrm.Page.getAttribute().setValue() to archieve this but I don't want to use this because Xrm.Page will be deprecated at some point in the near future. I tried to implement the formContext in my script but I dont get the executionContext in my index.ts so it seems this is also not an option.
 
If this is the inteneded behavior for custom controls i find it very weak because from my understanding it should be logical to easily change the value of the underlying field with simply changing the value of the bound parameter.
I could post some code if necessary, but maybe someone already understands my problem and can point me in the right direction.
 
Thanks in advance,
 
greetings from Germany
I have the same question (0)
  • OOlashyn Profile Picture
    3,498 Most Valuable Professional on at

    Hi @Anonymous ,

     

    You cannot directly change bound attribute. You need to define method called getOutputs (see official docs) for the system to understand how to retrieve new value for bound attribute. When you want the system to know that you changed the value you need to call method notifyOutputChanged that is passed to you as one of the parameters in the init function. You can check out real life examples for this in a component build by Tanguy Touzard here.

     

     

  • Verified answer
    Rick Wilson Profile Picture
    160 on at

    Just setting the value of the parameter is not enough to cause the change.  You will see that in the init function there is a notifyOutputChanged function that is passed.  This is what needs to be called when you want to update the underlying field.

     

    I recently created a DropDown list for Booleans to overcome a specific issues I was having where setting Booleans to the List option was not populating them as such in Business Process Flow Forms.  This should provide you with a good example of what you are trying to do. https://github.com/rwilson504/PCFControls/tree/master/BooleanOptionset/BooleanOptionset

     

    You can see below that I am first creating a private variable to hold the notifyOutputChanged event so that I can later use it in the OnChange event of a DropDown list.  I'm also creating a private variable _value to hold the final value I want to pass to the underlying field for the control.

     

    OnChange1.png

     

    Next in the OnChange event of the DropDown I am setting my local _value to the final value I want to pass to the field and then calling the nofityOutputChanged event.  This will call the getOutput function which is a base function of PCF functions.  The getOutput function will actually push the value to the underlying field.

     

    OnChange2.png

    Here is the getOutput function that finally pushes the value to the field.  inputValue is the bound value in my ControlManifest.Input.xml.

     

    OnChange3.png

     

     

    --Rick

     
  • Dynamics_User07 Profile Picture
    50 on at

    Hi @RAWilson Spot on!!

    I can understand the architect but my problem is I have two bound properties..i am written pcf to select multiple contacts and added it as Bound properties but I want to select child contact associatted with the account with the help of PCF. So, defined a new bound properties for account in manifest so that I can get the current ID of account( it's an another field on form and pcf is not registered on this) .Now, I am confused How to add the notifyoutput change for it as it is already added for contact bound in the exactly same manner you defined..so whenever I am changing the contact it is notifying the notifyoutput function..

    How Can I append it for Account (id) also so that whenever I change the account ,it triggers it and I get the current ID..

    Thanks in advance.

  • pooja_jayant Profile Picture
    Microsoft Employee on at

    --

  • Tucker_Robson Profile Picture
    6 on at

    It's difficult to understand what your problem is. Can you be a little more clear?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard