Use Find and Replace in the formula bar
In complex Power Apps, formulas can get lengthy. Locating and replacing portions of large formulas can become difficult. You can now use the Find and Replace capability for the selected control or property to easily find and replace the specified word or sequence of characters.
With Find and Replace capability, you can search for combinations of letters, numbers, words, and phrases within a formula in the formula bar. This capability also allows you to use text casing, whole words, and regular expressions to find and replace text inside formulas.
Prerequisites
- Sign up for Power Apps.
- Create an app or open an existing app in Power Apps.
- Learn how to configure a control.
Launch Find and Replace
You can launch the Find and Replace control in the formula bar using the Find and replace button, or shortcut keys. You can also pre-populate text in the search input.
To get started, create a new app, or edit an existing app in Power Apps Studio. Once open, use any of the following methods to launch the Find and Replace control.
Method 1: Use the Find and Replace button
Select the control or property that you want to edit.
Select the drop-down on the right-side of the formula bar to show the Find and Replace control.
Tip
You can also drag the formula bar down to expand the formula bar making it easier to read complex expressions.
Select Find and replace from the bottom of the formula bar.
Find and Replace control appears on the upper-right hand side of the formula bar.
Method 2: Use shortcut keys
Select the control or property that you want to edit.
While your cursor is within the formula bar, press Ctrl+F to find, or Ctrl+H to find and replace the specified word or sequence of characters in the formula.
Method 3: Launch Find and Replace with text already selected
You can also launch the control pre-populated with text from your formula that you wish to search for.
To do this, select or keep the cursor inside the formula bar over the section that you want to find or replace. And then, use Find and replace button, or the shortcut keys as described earlier to launch Find and Replace control.
Working with Find and Replace
When working with Find, you have three options to search the formula. When working with Replace, you have two options to choose from. We'll take a look at the options for both Find and Replace.
Find
Add text or characters to search for into the provided input area. And then, use the icons on the right-hand side of the input area to help refine your search:
Match case returns only matches with the specified case.
In the example below, instances of
TicketList
will appear as a match, butticketlist
wouldn't.Match whole word returns only exact matches of the entire sequence of characters.
In the example below, instances of
Ticket
returns no matches although the wordTicket
appears within the names several times in the formula.Use regular expression (RegEx) returns only matches conforming to the regular expression specified within the input area. More information: Regular expressions
In the example below, using the Regular Expression search capability with
Screen(Priority|Task)
returns matches forScreen
when it appears together with eitherPriority
orTask
as shown below.Previous match or Next match arrows allow you to move forward and backward through any matches the search returns. As you move through the matches, the match position updates and the row containing the match is highlighted to let you know which match you're currently working with.
Find in selection limits the search area within a formula to only the selected portion of a formula. To select part of the formula, select and hold at the beginning of the desired searching area and then drag your cursor to highlight the entire desired area. To select using the keyboard, move cursor focus to the beginning of the desired search area, then hold Shift key, and use the arrow keys to highlight the desired search area.
In the example below, the search has been limited to the selected area, so the search now only returns two matches instead of the four matches returned previously.
Replace
By default, the Find and replace control opens in collapsed format and only displays the Find capability. To expand the control and show the Replace capability, select the icon to the left of the search input box, or press Ctrl+H on your keyboard. To collapse again, select the rotated icon.
Collapsed replace mode:
Expanded replace mode:
In the Replace input area, specify the word or sequence of characters you’d like to replace the search text.
Use the Replace or Replace all icons to update one or all matches returned with the specified word or characters.
Replace
Replace all