Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

Form Context in PCF

(1) ShareShare
ReportReport
Posted on by 28

I am trying to get the form context of a form in my PCF component. Since Xrm.Page is deprecated, how can we get the form context in PCF Component?

  • AllanDeCastro Profile Picture
    412 Most Valuable Professional on at
    Re: Form Context in PCF

    Be careful, it depends on what you want to do.

     

    Indeed, the component has its own context but is sent to it from the application so if you want to access particular fields for example, you just have to add them as property of your PCF and you would have access to them.

     

     

  • Ben Thompson Profile Picture
    1,400 on at
    Re: Form Context in PCF

    Given that no-one seems to have answered your question I will step in and answer it.

     

    By design PCF components are designed to be self contained and do not have access to the Form context.

  • AllanDeCastro Profile Picture
    412 Most Valuable Professional on at
    Re: Form Context in PCF

    In the init function you have this: context: ComponentFramework.Context<IInputs>

    So you can use it like this : 
    context.png
  • Sunayana8 Profile Picture
    28 on at
    Re: Form Context in PCF

    How will I get the form context from context parameter passed in init function? Is there a function to do it?

    @sheldoncopper73 `

  • Sunayana8 Profile Picture
    28 on at
    Re: Form Context in PCF

    How will I get the form context from context parameter passed in init function? Is there a function to do it?

    @sheldoncopper73 `

  • Sunayana8 Profile Picture
    28 on at
    Re: Form Context in PCF

    How do i get the form context from the context parameter in init function? Is there a method that provides this?

    @sheldoncopper73 

  • Sunayana8 Profile Picture
    28 on at
    Re: Form Context in PCF

    How will I get the formContext using context parameter in PCF? Is there any function to get the formContext?

    @sheldoncopper73 

  • a33ik Profile Picture
    3,304 Most Valuable Professional on at
  • Sheldon Copper Profile Picture
    200 on at
    Re: Form Context in PCF

    In PCF we use context which is passed as parameter in init and updateView function. You can get pretty much all the things that are in Xrm. You can check the ComponentFramework declaration file or PCF Docs website for more info

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 85 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 65 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 55 Super User 2025 Season 1

Overall leaderboard