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 Apps
Answered

Component name

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi Folks,

 

Is it possible to store a "Component name" to a variable?

 

I am trying to create a dynamic Patch command that will update many different fields/components, depending on the field name that requested the update

 

Thanks,

Ricardo.

 

Categories:
  • Verified answer
    timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    Hi @Anonymous 

    If by 'component name', you mean the name of a data source or fields, it is not possible to store these in a variable.

    I answered similar question the other week that might be useful to you.

    https://powerusers.microsoft.com/t5/Building-Power-Apps/How-to-reference-a-datasource-without-loading-it-i-e-a-pointer/m-p/639363#M203013 

    The only way to create a dynamic Patch command would be to determine the field that requested the update using an If or Switch statement, and to call a Patch command that is specific to that condition.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @timl,

     

    Thanks for your reply. 

     

    I will definitely use this approach.

     

    Thanks,

    Ricardo.

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard