cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rcarneiroIE
Helper I
Helper I

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 @rcarneiroIE 

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-loadin... 

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 @rcarneiroIE 

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-loadin... 

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

Hi @timl,

 

Thanks for your reply. 

 

I will definitely use this approach.

 

Thanks,

Ricardo.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,112)