cancel
Showing results for 
Search instead for 
Did you mean: 

Patch - Referance a column name via a variable

Is that possible to make PowerApps can refer to a column via a variable?

 

I want to use "Patch" function to update column in Data Source. But the number of columns to be updated and columns name is not fixed. So it would be great of PowerApps to allow dynamically refer to a column.

 

 

For example, is it possible to replace the "DataField_8" below with dynamic variable such as "Dropdown2.Selected.Value"?

 

 
Patch(dbo_Update, LookUp(dbo_Update, ProductCode=Dropdown1.Selected.Value), {
    DataField_8 : TextInput1.Text
})
Status: Under Review

We hear you and appreciate your patience.  Unfortunately this is not easy for us to do.  Unlike VBA and other languages, Power Apps is strongly typed and named - everything is well established at compile time.  It's one of the fundamental principles of the product.  This allows us to detect more errors, optimize, and provide better intellisense during authoring.

 

Can you tell us more about the scenarios in which this would be helpful?  Some examples with code would be great.  Perhaps we can find a solution that addresses the need without making field names fully dynamic.

Comments
Level: Powered On

This is an important feature that enables easy data filtering and sorting in the app.  The alternative is writing big switch statements. 

Level: Power Up

Every programming language that I've seen has a way to do this. Eventually I think widespread adopting of PowerApps will be dependent upon this feature.

Power Apps Staff
Status changed to: Under Review

Updating status and adding @GregLi

Level: Powered On

As it stands, the only work-around I have for my app is to use a Switch case so that I can call the text literal for each individual column name. In a list with potentially dozens of iterative fields, the ability to call a specific column by variable would significantly improve the accessibility of the data I need. I'm gonna keep a close eye on any updates on this.

Level: Powered On

This is pretty critical of a feature. If we can please have this prioritized. It will prevent a bunch of embedded if statements. With many of us coming into this with Excel VBA knowledge, it doesn't make sense why it's not there yet. The work arounds are very convoluted.

Thanks!

Level: Powered On

Adding a comment in hopes this will change from under review to under development... unless there has been some work done on this for which I am unaware?

 

Thanks for the work your team does on PowerApps!

Level: Powered On

Any update on this? Its been Under Review for a VERY long time.

Level: Power Up

I too will chime in here: please prioritize this! It would prevent so much brute force convolution, and allow much simpler "intelligence" to be programmed into a Power App. This is currently a major wall in my design for our team hub.

Power Apps Staff
Status changed to: Under Review

We hear you and appreciate your patience.  Unfortunately this is not easy for us to do.  Unlike VBA and other languages, Power Apps is strongly typed and named - everything is well established at compile time.  It's one of the fundamental principles of the product.  This allows us to detect more errors, optimize, and provide better intellisense during authoring.

 

Can you tell us more about the scenarios in which this would be helpful?  Some examples with code would be great.  Perhaps we can find a solution that addresses the need without making field names fully dynamic.