{"id":27795,"date":"2024-04-10T01:00:20","date_gmt":"2024-04-10T09:00:20","guid":{"rendered":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-apps\/power-fx-no-more-columns-names-in-text-strings\/"},"modified":"2024-04-10T01:00:20","modified_gmt":"2024-04-10T09:00:20","slug":"power-fx-no-more-columns-names-in-text-strings","status":"publish","type":"power-apps","link":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-apps\/power-fx-no-more-columns-names-in-text-strings\/","title":{"rendered":"Power Fx: Column names escape double quotes"},"content":{"rendered":"
With Studio version 3.24042, rolling out to Preview this week, we are making a small syntax change to how column names are specified in some function arguments.\u00a0 Today they need to be wrapped in double quotes as a text string, but tomorrow they will not.\u00a0 The functionality of these functions is not changing in any way.\u00a0 We will automatically update the syntax in existing apps to reflect the new syntax – all existing apps will continue to operate as they do today.\u00a0 The change makes these functions consistent with other uses of column names, easier to use by no longer requiring logical names, and consistent with other Power Fx 1.0 hosts such as Copilot Studio, Power Automate Desktop, and Cards that have been using this new syntax for the last year.<\/p>\n
The impacted functions are:<\/p>\n
For example, today, this formula adds a Miles<\/strong> column to a table, calculated from the Kilometers<\/strong> column:<\/p>\n Tomorrow, write the formula with the new column name just as you would an existing column of the table, without double quotes:<\/p>\n It’s a subtle, but important difference.\u00a0 The use of a text string gave the impression that this name could be dynamic when it could not which led to maker confusion.\u00a0 It was inconsistent with other places where columns are used and defined, such as in the calculation at the end of the formula above and in a record definition.<\/p>\n This change also enables you to use display names.\u00a0 If the Contacts<\/strong>\u00a0table is in Dataverse, you would have previously needed to use logical names to reference the columns:<\/p>\n No longer, this can now be written much more elegantly as:<\/p>\n As shown here, use single quotes to insert a space or other special character in the name, as you would with variable names.<\/p>\n But wait… Aren’t we going to break all the existing apps in the world?\u00a0 Power Apps has a mechanism to update app formulas automatically.\u00a0 This change is only a syntax change, the behavior of these functions does not change, making it perfect to use this mechanism.\u00a0 Your apps will be automatically updated to the new syntax when they are loaded into Studio at or after version 3.24042. In general, you don’t need to do anything except to start using the new syntax for new formulas.<\/p>\n This is a part of Power Apps moving to Power Fx 1.0<\/a> that we could do without needing a feature switch. There are two more functions, SortByColumns<\/a><\/strong> and Validate<\/a><\/strong> that will be getting similar treatment, but since those could introduce a breaking change we decided to do that under the upcoming Power Fx 1.0 compatibility switch.<\/p>\n More examples:<\/p>\n If you have any concerns or questions, please leave them in the comments for this blog post.\u00a0 Thanks!<\/p>\n","protected":false},"excerpt":{"rendered":" We are making a small syntax change to how column names are specified in AddColumns, DropColumns, ShowColumns, RenameColumns, Search, GroupBy, Ungroup, and DataSourceInfo functions.\u00a0 Today they need to be wrapped in double quotes as a text string, but tomorrow they will not.\u00a0 We will automatically update the syntax in existing apps to reflect the new syntax.\u00a0 The change makes these functions consistent with other uses of column names, easier to use by no longer requiring logical names, and consistent with other Power Fx 1.0 hosts such as Copilot Studio, Power Automate Desktop, and Cards that have been using this new syntax for the last year.<\/p>\n","protected":false},"author":86,"featured_media":0,"comment_status":"open","ping_status":"open","template":"","power-apps-category":[1617,1664,1671],"power-apps-tag":[1618,1672],"coauthors":[2104],"class_list":["post-27795","power-apps","type-power-apps","status-publish","hentry","power-apps-category-formulas","power-apps-category-uncategorized","power-apps-category-power-fx","power-apps-tag-formulas","power-apps-tag-power-fx"],"yoast_head":"\nAddColumns( Distances, \"Miles\", Kilometers * 0.6214 )<\/pre>\n
AddColumns( Distances, Miles, Kilometers * 0.6214 )<\/pre>\n
Search( Contacts, TextInput1.Text, \"cr43e_firstname\", \"cr43e_lastname\" )<\/pre>\n
Search( Contacts, TextInput1.Text, 'First Name', 'Last Name' )<\/pre>\n
DropColumns( Distances, \"Kilometers\" )\u00a0 \u00a0 \/\/ before\nDropColumns( Distances, Kilometers )\u00a0 \u00a0 \/\/ after<\/pre>\n
RenameColumns( Distances, \"Kilometers\", \"Km\" )\u00a0 \u00a0 \/\/ before\nRenameColumns( Distances, Kilometers, Km )\u00a0\u00a0 \/\/ after<\/pre>\n
ShowColumns( Distances, \"Kilometers\" )\u00a0 \u00a0 \/\/ before\nShowColumns( Distances, Kilometers)\u00a0 \u00a0 \/\/ after<\/pre>\n
GroupBy( Sales, \"State\", \"Remainder\" ) \/\/ before\nGroupBy( Sales, State, Remainder ) \/\/ after<\/pre>\n
Ungroup( GroupedSales, \"Remainder\" ) \/\/ before\nUngroup( GroupedSales, Remainder ) \/\/ after<\/pre>\n
DataSourceInfo( IceCream, DataSourceInfo.Required, \"Flavor\" ) \/\/ before\nDataSourceInfo( IceCream, DataSourceInfo.Required, Flavor ) \/\/ after<\/pre>\n