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 Apps
• Rename 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.
Select Replace on the confirmation menu.
Now the collection name TicketsCollect1 is replaced with colTickets for every occurrence in the app.
Did You Enjoy This Article? 😺
Subscribe to get new Power Apps articles sent to your inbox each week for FREE
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.
Nice site, i love the design, which tool did you use to create it?
Ricardo,
I paid for a custom WordPress theme.
Hi Matt, thanks for this. Does/will this work in Teams Power Apps?
George
George,
Not sure, you’ll just have to dive in there for yourself and see 😉
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.
Hart,
I disagree with your argument. Everything is potentially bad in the hands of a novice. We let novices behind the wheel of a car everyday. But if we didn’t teach them they’d never learn.
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
Macie,
Thanks for the tip!
looking under Settings /Upcoming Features, the Search option does not appear an an option to enable – not sure why
Rtc,
The Search feature is now generally available in Power Apps. There is no need to enable it. This article was written while Search was in preview.