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 / Bug in context.mode.co...
Power Apps
Answered

Bug in context.mode.contextInfo property for subgrid : entityTypeName gives incorrect value

(0) ShareShare
ReportReport
Posted on by 113 Most Valuable Professional

When using context.mode.contextInfo, property entityId gives the id of the parent form record, which is what is expected. But property entityTypeName gives the name of the subgrid entity and not the parent form entity.

 

Two questions:

  • when contextInfo will come as a predefined and supported property of property "mode"?
  • when a fix can be expected for this bug?

Thanks

I have the same question (0)
  • Ben Thompson Profile Picture
    1,400 on at

    How are you accessing context.mode.contextInfo?

     

    contextInfo is not a published accessible attribute of context.mode within the PCF framework.

  • Tanguy TOUZARD Profile Picture
    113 Most Valuable Professional on at
    I know but this is the only way included (even if not documented, this is why I asked) that should let you know the context of the entity record the PCF component is rendered
  • Verified answer
    ToddTrotter Profile Picture
    Microsoft Employee on at

    Hi TanguyT, 

     

    Currently, this API is not documented and not supported.   We understand the need for controls to get this type of context information and will be exposing it through supported APIs soon.   

     

    Todd

  • Tanguy TOUZARD Profile Picture
    113 Most Valuable Professional on at
    Great! Please don’t forget to fix the bug where EntityTypeName shows the wrong value
  • Ben Thompson Profile Picture
    1,400 on at

    So that explains why my idea request for access to context.mode.contextInfo disappeared so quickly...

     

    I'm glad to hear it's arriving soon as that saves me writing the workaround I thought I would have to create to do things in a "supported" way...

  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Hi @TanguyT, I have a similar scenario where I need the parent ID and entity name in a subgrid control. Have you found a workaround? Look at the querystring parameters? Cheers

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

    Hi  @EricRegnier , 

     

    You can use context.mode.contextInfo.entityTypeName and context.mode.contextInfo.entityId.

    They are both unsupported for now, but they are working just fine.

     

    Kind regards,

    Diana

  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Thanks for confirming @DianaBirkelbach, but I can't access context.mode.contextInfo in the typings... I guess we need add the 

    @ts-ignore tag?
  • Tanguy TOUZARD Profile Picture
    113 Most Valuable Professional on at

    You are correct 

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

    Hi  @EricRegnier , 

     

    @ts-ignore is a possibility. The alternative is casting:

    (context.mode as any).contextInfo.entityId

     

     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

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 834

#2
Valantis Profile Picture

Valantis 533

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard