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 / Getting the component ...
Power Apps
Answered

Getting the component name in code

(0) ShareShare
ReportReport
Posted on by 41

We're trying to address a bunch of accessibility issues, one in particular is proving quite difficult.

 

We need to supply for="" atributes for our components in order for screen readers to correctly read out the component details for users with accessibility needs.

 

The problem we've got is that we would have multiple of the same PCF on a screen, so we need the name="" attribute in our HTML to be unique - Ideally we'd like to grab the name as defined in the PowerApp designer, I thought there'd be a way to do this from the context object but I'm not seeing anything obvious.

Is this possible?

If not, the only workaround we can think of is to set the name attribute as a random string within the PCF itself but that's not a great idea.

Thanks.

I have the same question (0)
  • Verified answer
    Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    Hi  @MCrawley2 , 

     

    You could use context.mode.label (https://docs.microsoft.com/en-us/powerapps/developer/component-framework/reference/mode?WT.mc_id=BA-MVP-5004107#label)

     

    If that's not appropriate, you could use the PCF parameteres : context.parameter.<your>.attributes ... In the worst case, you could even create a dedicated property for it, and let the maker decide.

     

    Hope this helps!

  • MCrawley2 Profile Picture
    41 on at

    Perfect, must have just missed that one! Thank you!

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

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 387

#2
timl Profile Picture

timl 340 Super User 2026 Season 1

#3
Vish WR Profile Picture

Vish WR 301

Last 30 days Overall leaderboard