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 Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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