Rename Variables In Power Apps With 1-Click



Power Apps find & replace tool is a powerful new feature. You can use it to quickly rename all occurrences of a variable or collection in your app. It is no longer necessary to change variable names one-by-one or download the app source code and change them in the VS Code editor. Now it is possible to rename variables in 1-click within Power Apps Studio. In this article I will show you how to rename variables and collections in Power Apps.


Table Of Contents:
• Enable The Search Feature In Settings
Rename A Variable In Power AppsRename A Collection In Power Apps




Enable The Search Feature In Settings

The Power Apps find and replace feature is currently in public preview so we must enable it. Go to the Settings menu, choose Upcoming Features then turn the Search feature on.



When Search is turned on a new magnifying glass icon appears in the left-navigation bar. The Search menu has a replace feature that can change variable and collection names across the entire app.




Rename A Variable In Power Apps

Renaming a variable in all Power Apps formulas is very easy with the find & replace feature. Start by choosing a variable name to change. In this example we will use the variable name EditRecord.



Go to the Search menu and search for EditRecord. Then write the new variable name gblCurrentRecord in the replace with field. Select Replace All at the bottom of the menu.



Click Replace to confirm the changes.



Now the variable name is changed to gblCurrentRecord in all of the app’s formulas.




Rename A Collection In Power Apps

The find & replace feature can also be used to rename collections in Power Apps. In this example we will rename TicketsCollect1.



Browse to the Search menu and search for TicketsCollect1. Then type colTickets in the replace with field and click replace all.

Power Apps Rename Collection



Select Replace on the confirmation menu.



Now the collection name TicketsCollect1 is replaced with colTickets for every occurrence in the app.





Questions?

If you have any questions about Rename Variables In Power Apps With 1-Click please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion.

Matthew Devaney

Subscribe
Notify of
guest

10 Comments
Oldest
Newest
Inline Feedbacks
View all comments
Ricardo
Ricardo
2 years ago

Nice site, i love the design, which tool did you use to create it?

George Ellis
George Ellis
2 years ago

Hi Matt, thanks for this. Does/will this work in Teams Power Apps?
George

hartHenry
hartHenry
2 years ago

This is extremely dangerous advice for a novice. If you have variables named CarsOnTheRoad and one named Carson, and you want to change Carson to Johnny, then unexpected results will occur. You will be renaming variables that you do not want to rename – so, I would advise against this suggestion. Unexpected results may occur.

MaciejHoracy
MaciejHoracy
2 years ago
Reply to  hartHenry

Hey Hart,
You can also use “match whole word”, “match case” and regular expressions when searching across the app. I think this helps avoid the scenario you described.
Matthew – maybe that’s worth adding to the article as well? 🙂

Best, Maciej

Zrzut ekranu 2022-09-13 090941.jpg
Rtc
Rtc
1 year ago

looking under Settings /Upcoming Features, the Search option does not appear an an option to enable – not sure why