cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Component name

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

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.

View solution in original post

2 REPLIES 2
timl
Super User
Super User

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.

Anonymous
Not applicable

Hi @timl,

 

Thanks for your reply. 

 

I will definitely use this approach.

 

Thanks,

Ricardo.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,199)