Find function in Power Apps
The Find function finds a string of text, if it exists, within another string and returns the starting position of the string that was found. Position 1 is the first character of the string.
Power Apps Syntax Find(FindString, WithinString [, StartingPosition ])
- FindString - Required. The string to find.
- WithinString - Required. The string to search within.
- StartingPosition - Optional. The starting position to start searching. If we don’t define, its value is 1.
Example : In this example, we use a text label control to give a string data source. Set the Text property of the Label control to the “Ashish Goel is a developer.”
Case 1: Basic search
Power Apps Formula
Here, Label1 is the name of the Text label control.
Case 2: When multiple results are found
The find function returns the first result that it found in the string, ignore the rest.
Power Apps Formula
As the “sh” string is also available at position 5, but the find function return the first result.
Case 3: With StartingPosition Parameter
We can get the later result by using the StartingPosition parameter in the function, which is optional.
Power Apps Formula
In the above formula, the StartingPosition parameter value is 3, so the function starts its search from the 3rd character.
Case 4: Case Sensitive Search
The Find function is case sensitive. To ignore case, first use the Lower function on the arguments.
Power Apps Formula
The Find function returns blank if the string in which we are searching doesn't contain the string for which we are searching.
The use of Lower function on the arguments.
Power Apps Formula