PowerApps Find Function With Examples

Do you know how to use and where to use the Find function in PowerApps? Do not worry, everything you will get to know in detail in this tutorial.

In this PowerApps tutorial, we will discuss what is the Find function, what is its syntax, and how a user can use it in many ways in PowerApps. Let us cover all these below topics by using some different scenarios.

  • PowerApps Find Function
  • PowerApps Find Function Syntax
  • PowerApps find and replace
  • PowerApps find duplicates in gallery
  • PowerApps find max value in column
  • PowerApps find and replace text
  • PowerApps find where a variable is used
  • PowerApps find meeting times
  • PowerApps find a record
  • PowerApps advanced find
  • PowerApps find user by email
  • PowerApps find user by id
  • PowerApps find user by name
  • PowerApps combobox find items
  • PowerApps can’t find sharepoint list
  • PowerApps find data source
  • PowerApps dropdown find items
  • PowerApps didn’t find that file
  • PowerApps find first day of week
  • PowerApps find email from name
  • PowerApps find filter
  • PowerApps find last item in gallery
  • PowerApps find group id
  • PowerApps find highest value
  • PowerApps find item in sharepoint list
  • PowerApps if find
  • PowerApps find largest number
  • PowerApps find length of string
  • PowerApps find user manager
  • PowerApps find max value in collection
  • PowerApps find max date
  • PowerApps find exact match
  • PowerApps find number in string
  • PowerApps quick find view
  • PowerApps find record in collection
  • PowerApps find space in string
  • PowerApps find value in sharepoint list

Table of Contents

PowerApps Find Function

  • PowerApps Find function is a type of function that finds a string within another string. Normally we can say, this function searches a string of text, if the searched string exists, within another string. This is one of the most important and useful function in PowerApps.
  • This PowerApps Find function is a case sensitive. Also, we can use the PowerApps Lower function on the arguments to ignore the case.
  • PowerApps Find function always returns the first character of the string. You can get the blank value if the searching string doesnot contain the string for that you are searching.

PowerApps Find Function Syntax

Below represents the syntax of PowerApps Find Function:

Find( FindString, WithinString [, StartingPosition ] )

Where,

  1. FindString = This is required. Specify the string to find.
  2. WithinString = This is also required. Provide the string to search within.
  3. StartingPosition = This is an Optional. It specifies the starting position to start searching. Where the Position 1 is the first character.

PowerApps find and replace

To work with the PowerApps Replace function, there is a detailed tutorial on my site. To learn all the related PowerApps find and replace things, have a look at this guide: PowerApps Replace Function with examples

Do you have any idea how you can find the duplicate records in a PowerApps gallery control? Check out the below scenario.

Example:

In this scenario, suppose you would like to do these below things:

  1. Do you want to display all the SharePoint duplicate items in the PowerApps gallery?
  2. Would you like the duplicate items in the gallery to be shown in merged or separated?
  3. Do you want an Icon to decide whether the gallery display all items or duplicate items?
  • I have a SharePoint list named Products where it contains some duplicate records. I would like to display all the records (including duplicate records) in a gallery control.
PowerApps find duplicates in gallery
PowerApps find duplicates in gallery
  • For this, we can take a PowerApps icon to determine whether display all items or duplicate items and show them in a separated form. You can refer to the below screenshot what everything looks exactly in the app.
  • So in the search icon, I want to specify the formula. When a user will click on the search icon for the first time, then the gallery will appear with all list records. Similarly, when the user will click again that icon, then the gallery will appear with only duplicate records.
Power Apps find duplicates in gallery
  • To achieve this, we will create a context variable on search icon’s OnSelect property as:
OnSelect = UpdateContext({DuplicateValue: !DuplicateValue});

Where,

DuplicateValue = Context variable name

find duplicates in gallery PowerApps
find duplicates in gallery PowerApps
  • Next, select the gallery control and apply the below code on its Items property as:
Items = If(
    DuplicateValue,
    Filter(
        Ungroup(
            AddColumns(
                GroupBy(
                    Products,
                    "Title",
                    "dupname"
                ),
                "dup",
                CountRows(dupname)
            ),
            "dupname"
        ),
        dup > 1
    ),
    SortByColumns(
        Filter(
            Products,
            StartsWith(
                Title,
                TextInput1.Text
            )
        ),
        "Title"
    )
)

Where,

  1. DuplicateValue = Variable name
  2. Products = SharePoint list name
  3. Title” = SharePoint column name
  4. dupname“, “dup” = New field name
  5. TextInput1 = Text input control name

The above code specifies the first group the collection by the column Title and duplicates records in the table of the ”dupname” field, then add a column to store the results of CountRows(), then Ungroup and we get a table with a column of “dup” in which is the count of lines, we only need to filter the result of >1 which means more than one record.

PowerApps find duplicates in gallery control
PowerApps find duplicates in gallery control

This is how to work with PowerApps to find duplicates in a gallery control.

PowerApps find max value in column

Do you want to find the maximum value in a SharePoint field or a gallery control? In this scenario, we will see how to find the maximum value from a PowerApps gallery.

  • I have a gallery control where all the items are retrieved from the SharePoint list (Products). Now I would like to findout the maximum number of quantity value i.e. present in the gallery and the outcome will appear in a label control.
Power Apps find max value in column
Power Apps find max value in column
  • To workaround with this, select the label control and apply the below formula on its Text property as:
Text = "Maximum Quantity: " & Max(
    Gallery3.AllItems,
    Quantity
)

Where,

  1. Maximum Quantity: ” = This specifies the string that will display in the label control
  2. Gallery3 = Gallery control name
  3. Quantity = Specify the SharePoint column name that you want to find the maximum number
  • Not only the gallery control, but also if you want to find out the maximum quantity from the SharePoint ist itself, then you can write the below code:
Text = Max(
    Products,
    Quantity
)

Where,

  1. Products = SharePoint list name
  2. Quantity = SharePoint field with Number data type
PowerApps find max value in column
PowerApps find max value in column

Once you will save and preview the app, you can see the result in the label control.

This is how to work with the PowerApps find max value in column.

PowerApps find and replace text

Here we will discuss what does the mean of PowerApps find and replace text.

  • In the below image, you can see there is a text input control and label control. Now I would like to block every “” character that is entered into the text box.
  • For example, when a user will enter a mobile number (including hyphen ), then the label will display without the special character hyphen (““) as shown below.
PowerApps find and replace text
PowerApps find and replace text
  • To do so, select the label and set the below code on its Text property as:
Text = Substitute(
    txtEnterMblNo.Text,
    "-",
    ""
)

Where,

txtEnterMblNo. = Text input control name

Power Apps find and replace text
Power Apps find and replace text

This explains how to work with PowerApps find and replace text.

PowerApps find where a variable is used

  • Whenever you are using a variable (either global or local variable) in PowerApps, you should know the place where the variable stores inside the app. Also, you should know where the specific variable is used in the app.
  • So while we are creating a PowerApps variable, it stores in the Variables section. Once you will open that section, you can see all the variables (global or local) that you have created in the app.
  • To view all the variables, go to the View tab -> click on Variables as shown below.
PowerApps find where a variable is used
PowerApps find where a variable is used
  • When you will click on the Variables, you can see all type of variables that you have used in the app. You can click on any of the created variable that you want to view.
Power Apps find where a variable is used
  • To view where you used the specific variable, tap on it. While you will tap on it, it will directly go to that specific place where you have created inside the app.
PowerApps find where variable is used
PowerApps find where variable is used

This is what the mean of PowerApps find where a variable is used.

PowerApps find meeting times

This topic will explain how to retrieve the complete Meeting times in PowerApps. Read this PowerApps forum link to know the details: PowerApps find meeting times

PowerApps find a record

Do you want to find a specific record in PowerApps? To achieve this easily, we can use the PowerApps Search function. To learn more details about this function, refer to this PowerApps tutorial: PowerApps find a record

PowerApps advanced find

This topic is related to the PowerApps Dataverse search. You can use the Advanced Find search option to find the rows that you want in your app. To know more details, follow this MSDN article: PowerApps advanced find

PowerApps find user by email

Here we will see how to find the user by email in PowerApps.

  • In this scenario, I would like to get the non-current user’s email address with only the non-current user’s name. So what happens is, when a user will enter the other user names, then he/she can view that specific user email address.
  • To achieve this, we need the Office365Users connector in the app. Once you will connect it, apply the below code on the text input’s Default property as:
Default = First(Office365Users.SearchUser({searchTerm: "Sonam"})).Mail

Where,

Sonam” = You need to specify the user name whose you want to view the email address

PowerApps find user by email
PowerApps find user by email

Also, you can go through this full PowerApps guide to learn PowerApps Get Current User (ID, EMail, Department, Location, Photo, etc)

PowerApps find user by id

As we already know how we can find out the current user Details (including User ID) in PowerApps. But in the below scenario, we will see how a current user can get another user’s ID in PowerApps.

Here we will see the PowerApps Dropdown control to show the User ID with digits and as well as with the specific character hyphen (“-“).

  • The below screenshot represents a PowerApps Dropdown control where I want to display the ID of another user. Select the dropdown control and apply the below code on its Items property as:
Items = Substitute(
    Office365Users.SearchUser({searchTerm: "Bijay"}).Id,
    "-",
    ""
)

Where,

  1. Substitute = PowerApps Substitute function helps to identify the string to replace by matching a string. Also, you can replace the text if more than one match is found.
  2. Bijay” = Specify the user name whose you want to view the ID in the dropdown menu
  3. Id = As I need the user ID, so we need to specify the value as “.Id
PowerApps find user by id
PowerApps find user by id
  • Once you will save and preview the app, then the user ID will display with only digits in the dropdown menu.
  • If you want to display the user-ID with the special character (-), then write the below code on Dropdown’s Items property as:
Items = Office365Users.SearchUser({searchTerm: "Bijay"}).Id

Refer to the below screenshot.

Power Apps find user by id
Power Apps find user by id

This is how to work with PowerApps find user by id.

PowerApps find user by name

Like PowerApps user by Email, PowerApps user by Id, you can also find the user by name in the app.

  • To get the user name in PowerApps, you need to use the Office365Users connector to the app. You can find the user by using the DisplayName, GivenName, Surname, etc.
  • Select the Text input control and apply the below code on its Default property as:
Default = First(Office365Users.SearchUser({searchTerm: "Bijay"})).DisplayName

If you want to find the user’s given name or surname, then you can use the “.GivenName” or “.Surname” instead of the “.DisplayName“.

PowerApps find user by name
PowerApps find user by name

This is how to use PowerApps to find user by name.

PowerApps combobox find items

From the topic name itself, you may think that what does the mean of Combobox find items in PowerApps. So as I searched on some sites, I got some interesting things about this.

  • In the below screen, you can see there is a Hint text in the PowerApps ComboBox control. Whenever you will add this control to the app, every time you may see the hint text as “Find items“. Here, I would like it to display something more appropriate like “Please Enter Your Name” as in the below screenshot.
  • So to change the hint text of the Combo box control, there is a property called InputTextPlaceholder within the control. Select the combo box control and set the value as:
InputTextPlaceholder = "Please Enter Your Name"

You can specify any text that you want. And the text should be present within the inverted comma (” “).

PowerApps combobox find items
PowerApps combobox find items

This is what the meaning of PowerApps Combobox find items.

PowerApps can’t find sharepoint list

  • Sometimes for the new PowerApps Beginners what happens is, manually they can not connect the SharePoint list to the app correctly. Actually, this type of problem occurs when the user can not give the proper SharePoint Site URL.
  • Even if when they click on “Create PowerApp” directly from the SharePoint list, then the Powerapps will open and create correctly a new app with the list’s data. This works correctly for them but as described above if the user will MANUALLY insert/connect to this list then they can’t find them.
  • For example, suppose the SharePoint List URL is “https://tsinfotechnologies.sharepoint.com/sites/PowerApps/Lists/TSInfoAttachments/AllItems.aspx“. Then in the app while you are connecting the list, we should specify the Site URL with the following: “https://tsinfotechnologies.sharepoint.com/sites/PowerApps/“. (Make sure the connector should be a harePoint site)

Once you will enter the SharePoint site URL, then the connection issue will be fixed.

PowerApps find data source

  • Here we will see how to find out the DataSource details which are added to the PowerApps.
  • Some of the beginners, they do not know where they can view the Data source connection details once it added to the app. Or may be some of them think that, Is there any way to find the DataSource details after it was added to the app.
  • For all of these above question, there is one solution called PowerApps Data or Data sources where a user can view their all the data source connections that he is used in the app. There are different types of data source connectors like SharePoint, Excel table, OneDrive for Business, etc.
  • There are two different ways to view the PowerApps Data source. Such as:
  1. Using Data option
  2. Using via View tab
  • You can directly go to the Data option i.e. present in the left navigation. Also, you can go to the View tab -> click on the Data sources. Once you will click on it, you can see all the data source connectors that you have used in the app.
  • If you want to add a new data source connector to the app, then click on the +Add data option and select the data source that you want to add.
  • Suppose you want to refresh any of the data source in the app, then you can do it from here. Select any data source connector (that you added to the app) -> Click on elipses () -> Refresh.
PowerApps find data source
PowerApps find data source

This above point explains what the mean of PowerApps find data source.

PowerApps dropdown find items

To learn all the details about the PowerApps Dropdown control, you can check out this tutorial: PowerApps Dropdown Gallery + Examples

PowerApps didn’t find that file

  • Sometimes what happens is, we can not display any record in the Edit form and a gallery control even if all the data connections are fine in PowerApps.
  • So at that moment, we may think that whether it is a problem from our side or Powerapps Can’t find data in the table. And after that, we are rechecking again to the form or gallery control.
  • Also, sometimes PowerApps beginners also, they do not know where they can put the formula in any of the control properties. So that time also, this problem may occur.
  • Here I will recommend one thing, whenever you will use an Edit form, then you should apply the data source name on its Item property. Simiarly, when you will use a Gallery control, then you should apply the data source name on its Items property. So this may resolve your issues.

PowerApps find first day of week

In this topic, we will see these below things:

  1. PowerApps get the date of the current week of Monday
  2. PowerApps get the date of the current week of Friday
  3. PowerApps get the date of the next week Monday
  4. How to find the week start date in PowerApps

Get the date of the current week of Monday

  • If you want to retrieve the date of the current week of Monday, then you can follow the below code. You can apply your code either in a Date picker control or a Label control.
  • If you are using a Date picker control, then set the below formula on its DefaultDate property as:
DefaultDate = DateAdd(
    Today(),
    1 - Weekday(
        Today(),
        StartOfWeek.Monday
    ),
    Days
)

Refer to the below screenshot.

PowerApps find first day of week
PowerApps find first day of week
  • Once you will apply the formula on the date picker control, then you can see the date of the current week of Monday. As my current date is 1/27/2022, so my current week Monday was on 1/24/2022 as shown above.

Get the date of the current week of Friday

  • Similarly, if you want to retrieve the date of the current week of Friday, then you can follow the below code. Select the Date picker and set its DefaultDate property as:
DefaultDate = DateAdd(
    Today(),
    1 - Weekday(
        Today(),
        StartOfWeek.Monday
    ) + 4,
    Days
)

Refer to the below image.

Power Apps find first day of week
Power Apps find first day of week
  • Once you will apply the formula on the date picker control, then you can see the date of the current week of Friday. As my current date is 1/27/2022, so my current week Friday will be on 1/28/2022 as shown above.

Get the date of the next week of Monday

  • Now suppose you want to get the date of the next week of Monday, then what’s the formula that we can follow. it’s so simple.
  • Insert a Label control and apply the below code on its Text property as:
Text = "Date of Next Week Monday: " & Today() + 7 - Weekday(
    Today(),
    MondayZero
)

Where,

Date of Next Week Monday: ” = This is the string that will display in the label control

PowerApps get date of the next week of Monday
PowerApps get date of the next week of Monday
  • When you will apply the formula on the label control, then you can see the date of the next week of Monday. As my current date is 1/27/2022, so my next week Monday will be on 1/31/2022 as shown above.

PowerApps find the week start date

  • In this scenario, I would like to get the week start date when the user selects the week number and as well as the year. Both week number and year are two separate drop-down controls. So follow the below processes to achieve this.
  • The below screenshot represents the whole structure of this scenario. Here, the user selected the Week Number as 3 and the Year as 2022. That means the user wants to get the date of the 3rd week of the 2022 year. And the result you can see in the label control i.e. Monday, January 17, 2022 (as the third week of the 2022 year starts from 17th).
PowerApps find the week start date
PowerApps find the week start date
  • To do so, first you need to take two Dropdown controls and rename it to ddWeekNumber and ddYear. Now, select the week number dropdown control (ddWeekNumber) and set its Items property to the below code:
Items = Sequence(
    DateDiff(
        Date(
            ddYear.Selected.Value,
            1,
            1
        ),
        Date(
            ddYear.Selected.Value,
            12,
            31
        ),
        Days
    ) / 7
)

Refer to the below image.

Power Apps find the week start date
Power Apps find the week start date
  • When you will add this above code, the week number dropdown list will appear with all the week numbers i.e. starting from 1 to 52.
  • Next, select the Year drop down control (ddYear) and set its Items property as:
Items = ["2021", "2022", "2023"]
get the week start date PowerApps
  • To view the result, add a label control and apply the below code on its Text property as:
Text = "Week Start Date: " & With(
    {
        _weekDate: DateAdd(
            Date(
                ddYear.Selected.Value,
                1,
                If(
                    Weekday(
                        Date(
                            ddYear.Selected.Value,
                            1,
                            1
                        )
                    ) > 3,
                    7,
                    1
                )
            ),
            (ddWeekNumber.Selected.Value - 1) * 7,
            Days
        )
    },
    Text(
        DateAdd(
            _weekDate,
            Weekday(
                _weekDate,
                StartOfWeek.MondayZero
            ) * -1,
            Days
        ),
        LongDate
    )
)

Review the below screenshot.

PowerApps get the week start date
PowerApps get the week start date
  • When you will save and preview the app, you can see the outcome in the label control as shown above.

This is how to work with PowerApps find the first day of the week.

PowerApps find email from name

Do you want to get the user email from its name itself in PowerApps? In the below scenario, I would like to retrieve the user email addresses that are present in the SharePoint list first row.

  • As you can see there is a SharePoint List named Book Purchase Info. This list has a Person column called Book Seller (Enable allow multiple selections).
  • Now in PowerApps, I would like to get the email addresses (Book Seller) of the first item from this list. This means it will retrieve multiple user addresses that are present in the first row.
PowerApps find email from name
PowerApps find email from name
  • To work around this, I have created a PowerApps Collection (called colPeopleEmail) where I stored the list person field values. Then I have added that field into a Dropdown control.
  • Select the Dropdown list and set its Items property to the below code as:
Items = First(colPeopleEmail).'Book Seller'.Email

Where,

  1. colPeopleEmail = Collection name
  2. Book Seller‘ = Person field name
Power Apps find email from name
Power Apps find email from name
  • Save and Preview the app. Once you will click on the dropdown chevron, you can see multiple user email addresses i.e. present in the first row of SharePoint list.

To get more details, check out this PowerApps forum link: How to get an Email address from a Person type column from Collection

PowerApps find filter

Do you want to work with all the filter functions in PowerApps? To learn all these PowerApps filter related things, refer to this complete tutorial: PowerApps find filter

In case you need to get the last item in the PowerApps gallery control, then what exact formula you should follow, and where you can apply it. Follow the below scenario.

  • In the app, there are two Gallery controls where one is for displaying all the records from the SharePoint list and another one is for displaying the result.
  • In this example, I would like to find the last item that is present within the main gallery control. For this, we can easily get the result by using the PowerApps Last function.
PowerApps find last item in gallery
PowerApps find last item in gallery
  • To achieve this, select the result gallery and set its Items property to the below code as:
Items = Last(galBookColection.AllItems)

Where,

galBookColection = First gallery control name where all the records are present

Power Apps find last item in gallery
  • Once you applied the above formula, you need to specify the label text value inside the result gallery i.e.
Text = ThisItem.Title

Where,

Title = Specify the SharePoint field name. Not only this field, but also you can set any SharePoint field that you want to view in the gallery control.

This is how to work with PowerApps to find the last item in the gallery control.

PowerApps find group id

Do you want to get the Group ID in PowerApps? Check out this PowerApps tutorial to get everything details about the group ID: PowerApps find group id

PowerApps find highest value

  • As we already discussed above that how we can find out the highest or maximum value in PowerApps. To achieve our needs, we can use the PowerApps Max function.
  • PowerApps Max function helps to find out the maximum value from a table or a collection or a SharePoint list, etc.

PowerApps Max Function Syntax

Below represents the syntaxes of the PowerApps Max function.

Syntax – 1:

Max( NumericalFormula1, [ NumericalFormula2, ... ] )

Where,

NumericalFormula(s) = This is required. You need to specify the numeric values to operate on.

Syntax – 2:

Max( Table, NumericalFormula )

Where,

  1. Table = This is rquired. Specify the table to operate on.
  2. NumericalFormula = This is also required. Specify the formula to evaluate for each record. The result of this formula is used for the aggregation. You can use columns of the table in the formula.

PowerApps find item in sharepoint list

Suppose you want to search for any SharePoint List item and display it in PowerApps. Then follow the below processes to achieve this in PowerApps.

  • In the below screenshot you can see there is a Search box (Text input) and a Data table control in the app. All the records are retrieved from a SharePoint list named Products.
  • So when the user does not search anything, then the data table appears with all the SharePoint list records. And when the user is searching for something (any particular SharePoint list item) in the search box, then the data table is filtering and displaying with the user searchable related items.
PowerApps find item in sharepoint list
PowerApps find item in sharepoint list
  • To do this, select the data table control and apply the below formula on its Items property as:
Items = Filter(
    Products,
    StartsWith(
        Title,
        txtSearchBox.Text
    )
)

Where,

  1. Products = Provide the SharePoint list name
  2. Title = Specify the SharePoint column name that you want to search in the search box
  3. txtSearchBox = Text input control name where the user will search the product title
PowerApps find item in sharepoint
PowerApps find item in sharepoint
  • So in the above screenshot, When I searched the product title as “La“, then the data table filtered and displayed all the Laptop details like Vendor, Customer Name, Quantity, etc (from the SharePoint list).

To learn more about PowerApps Search related things, you can refer to this complete tutorial: PowerApps Search Function + How to use with example

This is how to use PowerApps find the item in SharePoint list.

PowerApps if find

Check out this PowerApps forum link to get some idea that how to use the find function in PowerApps: PowerApps if find

Also, read this PowerApps tutorial to know more details about PowerApps If Statement

PowerApps find largest number

In this topic, we will see how to work with PowerApps find largest number.

Basically, here I would like to collect the values from the first collection to the second collection where the second one will have the largest number only. Let’s take a simple scenario.

  • First of all, I have a SharePoint list named Book Purchase Info. This list has some columns like:
  1. Book Name = By default, it is a Title column, just I renamed it to Book Name
  2. Book Price = Currency data type
  3. Sales Date = Date Time column
  4. Book Seller = Pesron or people picker column
  • Now I will create a collection by using this SharePoint list. So I applied the formula on the screen’s OnVisible property as:
OnVisible = ClearCollect(
    colBookDetails,
    'Book Purchase Info'
)

Where,

  1. colBookDetails = Specify the Collcetion name where all the SharePoint records will store
  2. Book Purchase Info‘ = Specify the SharePoint list name

Next, I will create a second PowerApps collection where it will filter the first collection Book Price values and display only the highest price details.

PowerApps find largest number
PowerApps find largest number
  • Let’s say, there is a Button control named Click here to find highest Records. So when a user will press the butoon, then the second collection will create with only the highest book price values (that will retrieve from the first collection).
  • Also, the result will display in the Data table control as shown in the below screenshot.
Power Apps find largest number
Power Apps find largest number
  • To work around with this, select the button and apply the below code on its OnSelect property as:
OnSelect = ClearCollect(
    colMaxResult,
    FirstN(
        Sort(
            colBookDetails,
            'Book Price',
            Descending
        ),
        2
    )
)

Where,

  1. colMaxResult = Second collection name where the result will store
  2. colBookDetails = First collection name
  3. Book Price‘ = Specify the collection column name to view the highest record
  4. 2 = This is the count that how many highest records you want to display in the second collection. Not only 2, but also you can specify any number like 3, 4, 5, and so on highest entry that you want. If you will specify the count as 5, then you will get the fifth highest record.
PowerApps find largest number in collection
  • At last, to view the highest records in a data table, you need to set the second collection name on the table’s Items property as:
Items = colMaxResult
  • You can edit the table (by using Edit fields property) to view more columns in the data table control. Hence, I need only 2 highest records from the collection, that’s why the data table appears with two highest record details.
PowerApps find largest number in SharePoint
PowerApps find largest number in SharePoint

So this is a simple scenario that how we can use the find function to find the largest number in PowerApps.

PowerApps find length of string

  • Suppose you want to find the length of any string or text, then simply you can use the PowerApps Len function. This Len function is used to return the length of a string of a text.
  • To learn more details about the Len function and its uses, check out this PowerApps tutorial: PowerApps find length of string

PowerApps find user manager

Do you want to get the user manager information in PowerApps? Follow the below different scenarios.

Example – 1:

  • In this scenario, I would like to get the current user manager name in PowerApps. You can show the user Manager name in a label control in the app. Before doing that, you must ensure to connect the Office365Users connector to the app.
  • Select the label and apply the below code on its Text property as:
Text = "Manager Name: " & Office365Users.ManagerV2(Office365Users.MyProfileV2().id).displayName

Where,

“Manager Name: “ = It is optional. Specify the string that will appear in the label control

PowerApps find user manager
PowerApps find user manager
  • If you want to display the user manager name in a Person or Group column or choice, then apply the below formula on a Dropdown control’s Items property as:
Items = [Office365Users.ManagerV2(Office365Users.MyProfileV2().id).mail]

Where,

mail = If you want to view the current user manager’s mail address, then specify the value as .mail

Power Apps find user manager

Once you will save and preview the app, you can see the current user manager email address in the dropdown control as shown above.

Example – 2:

If you want to get the Manager name of a particular user in PowerApps, then follow this pretty simple scenario.

  • In the below screenshot, there is a ComboBox control and a Label control in the app. When a user will search any specific employee name from the combo box, then the label control will display with the specific user’s Manager name as shown below.
PowerApps get user manager
PowerApps get user manager
  • To do this, you must ensure to connect the Office365Users connector to the app. Select the Combo box control and set its Items property to the below code:
Items = Office365Users.SearchUser()

Even if you will enable the Allow multiple selections option of the combo box, it will get only the current selected user’s Manager name.

Power Apps get user manager
Power Apps get user manager
  • Then, select the label control and apply the below code on its Text property as:
Text = "Manager Name: " & Office365Users.Manager(ComboBox5.Selected.Id).DisplayName

Where,

  1. “Manager Name: “ = This is the string that will display in the label control
  2. ComboBox5 = Combo box control name
  3. DisplayName = If you want to view the display name of the Manager, then you need to specify the parameter value as .DisplayName. Similarly, if you want to view the email address of the Manager, then you need to specify the value as .Mail.

Refer to the below image.

get user manager in PowerApps
get user manager in PowerApps

Example – 3:

In this scenario, we will get the current logged-in user’s Manager’s Manager Display Name or Email.

  • In the below screenshot, you can see the Current Logged-in user, Current logged-in user’s Manager, and Current logged-in user’s Manager’s Manager name. All names are displaying in different label controls.
PowerApps get user manager's manager
PowerApps get user manager’s manager

PowerApps get Current Logged-in user Name

  • In PowerApps, to get the current logged-in user name, apply the below code on Label’s Text property as:
Text = "Current Logged-in User: " & User().FullName
PowerApps get manager's manager
PowerApps get manager’s manager

PowerApps get Current Logged-in user’s Manager Name

  • In PowerApps, to get the current logged-in user’s Manager name, apply the below code on Label’s Text property as:
Text = "Current logged-in user's Manager Email: " & Office365Users.Manager(User().Email).DisplayName
  • As I would like to display the Manager’s Display name, so I specified the value as .DisplayName. If you want to view the Manager’s Email address, then you need to specify the value as .Mail
get manager's manager in PowerApps
get manager’s manager in PowerApps

PowerApps get Current Logged-in user’s Manager’s Manager Name

  • Similarly, to get the current logged-in user’s Manager’s Manager name, apply the below code on Label’s Text property as:
Text = "Current logged-in user's Manager's Manager Email: " & Office365Users.Manager(Office365Users.Manager(Office365Users.MyProfile().Mail).Mail).DisplayName

Refer to the below screenshot.

get manager's manager in Power Apps

These are the ways to achieve user’s manager name in PowerApps.

PowerApps find max value in collection

Suppose you want to find the highest or largest value in a PowerApps collection, then you can achieve it by using a simple code.

  • There is a PowerApps Collection named colBookDetails (where all the records are retrieved from the SharePiint list). This collection has a Currency field called Book Price.
  • Now I would like to find the most highest price of the book from this PowerApps collection.
PowerApps find max value in collection
PowerApps find max value in collection
  • To get it in the app, insert a label control and set its Text property to the below code as:
Text = "Highest Book Price: " & Max(
    colBookDetails,
    'Book Price'
)

Where,

  • colBookDetails = Collection name
  • Book Price‘ = Specify the field or column name from where you want to view the highest value
Power Apps find max value in collection

This is how to work with PowerApps find max value in collection.

PowerApps find max date

In this scenario, I want to get all the records of the latest date to show in the PowerApps gallery.

  • The below screenshot represents the SharePoint list named Book Purchase Info. This list has a Date column called Sales Date. Now I would like to retrieve all the items of the latest date and display in a gallery control.
  • You can see there are total two records i.e. from the recent or latest date (PowerApps Functions and PowerApps Flow)
PowerApps find max date
PowerApps find max date
  • To workaround with this, select the gallery control and set its Items property to the below code:
Items = Filter(
    'Book Purchase Info',
    'Sales Date' = First(
        Sort(
            Distinct(
                'Book Purchase Info',
                'Sales Date'
            ),
            Result,
            Descending
        )
    ).Result
)

Refer to the below image.

Power Apps find max date
Power Apps find max date

Once you will save and preview the app, the gallery will filter and display with the latest sales date records as shown in the above screenshot.

This is how we can work with PowerApps find max date.

PowerApps find exact match

In this topic, we will see how to work with PowerApps find exact match.

  • As you can see, there is a Text input control and a Gallery control. The gallery contains all the records from a SharePoint list named Products.
  • Sometime what happens is, whenever we are entering the first letter of a string in the text box, then the gallery filters and displays those specific records. But here I need to find the 100% match not a little match is enough to filter the gallery.
  • For example, suppose I will search in the text box as only D instead of DELL, then the word will not match exact and the gallery will not filter anything. If you will search DELL, then the gallery will filter and display everything related to the DELL vendor only.
PowerApps find exact match
PowerApps find exact match
  • To achieve this, apply the below code on gallery’s Items property as:
Items = If(
    !IsBlank(txtEnterTitleOrVendor.Text),
    Filter(
        Products,
        Title = txtEnterTitleOrVendor.Text Or Vendor.Value = txtEnterTitleOrVendor.Text
    )
)

Where,

  1. txtEnterTitleOrVendor = Specify the text input control where you will enter the Title or Vendor
  2. Products = SharePoint list name
  3. Title = Specify the column that you want to search in the text box control
  4. Vendor.Value = As this is a SharePoint choice column, so we need to specify this field with a .Value
Power Apps find exact match
Power Apps find exact match in a gallery
  • Save and preview the app. Type either product title or vendor name (full name) in the text box, then the gallery will display with all the user searchable records.

This is what the meaning of PowerApps find exact match.

PowerApps find number in string

In PowerApps, do you want to extract the Number value from a text string? Go through the below cases.

Example – 1:

  • For example, in the app, I have a string TSInfo002 in a Context variable. Now I would like to get only the number 002 and assign it back to that context variable. For reference, you can overlook to the below gif.
PowerApps find number in string
PowerApps find number in string
  • To achieve this, we will use the Substitute function. Insert two Button controls (Click to Initialize and Tap to extract Number). Also, add a label control where you can view the result.
  • At first, we will create a context variable and store the string value in it. To do so, select the OnSelect property of the first button (Click to Initialize) and apply the below code:
OnSelect = UpdateContext({ctxVar: "TSInfo002"})

Where,

  1. ctxVar = Specify a context variable name
  2. TSInfo002” = Specify the string from where you want to retrieve the number only
Power Apps find number in string
  • Next, select the second button (Tap to extract Number) and set the below formula on its OnSelect property as:
OnSelect = UpdateContext(
    {
        ctxVar: Substitute(
            ctxVar,
            "TSInfo",
            ""
        )
    }
)

Where,

  1. ctxVar = Specify the same created context variable name
  2. TSInfo” = Specify the string part that you want to remove from the main string
find number in string PowerApps
find number in string PowerApps
  • At last, to view the outcome, apply the below formula on Label’s Text property as:
Text = "Variable value: " & ctxVar

Refer to the below image.

PowerApps get number in string
PowerApps get number in string

So this is one of the ways to retrieve the number from a PowerApps string.

Example – 2:

  • In this scenario, in PowerApps, I want to find the total number of A from a string. A user will enter the string in the text input control, then it will calculate total number of A that is present in the string and display in label control.
  • Let us say, I entered a text as AUSTRALIA, then it finds total number of A i.e. present in the specified string. As the result is three, so the label displayed as the number of 3.
  • To achieve this, select the label control and apply the below code on its Text property as:
Text = "Count total number of A: " & CountRows(
    MatchAll(
        txtEnterLocation.Text,
        "A"
    )
)

Where,

  1. Count total number of A: ” = This is the string that will display in the label control
  2. txtEnterLocation = Text input control name
  3. A” = Specify the alphabet that you want to findout from the text
Power Apps get number in string
Power Apps get number in string

Example – 3:

  • Here we will see how we can find the total number of special character from a PowerApps string. For example, I have a string named “www.SPguides.com“. Now I would like to find the total number of special characters (.) i.e. present in this string.
  • To workaround with this, we can use the PowerApps MatchAll function. Select the label control and apply the below code on its Text property as:
Text = "Total Number of special characters: " & CountRows(
    MatchAll(
        "www.SPguides.com",
        "\."
    )
)

Where,

  1. Total Number of special characters: ” = This is the string that will display in the label control
  2. www.SPguides.com” = Specify the string where you want to find out the special character
  3. \.” = Here you need to escape this with a \ symbol
PowerApps find number in a string
PowerApps find number in a string

As in the specified string, there is a total number of two special characters, the result 2 is appearing in the label control.

This is how to work with PowerApps to find number in string.

PowerApps quick find view

In PowerApps, do you want to do a quick search to find some information that you are looking for? To get all the details about the quick view, refer to this MSDN: PowerApps quick find search

PowerApps find record in collection

In this scenario, we will see how we can display the value of a specific field/column (suppose row 2, column 1) of a collection. And the result will display in a label control.

  • In the below image, you can see there is a Data table control, a Button control (Retrieve Value), and a Label control. In the data table control, all the records are retrieved from a collection.
  • When the user will click on the button (Retrieve Value), I would like to retrieve the second item value of the first column i.e. PowerApps Functions and it will display in the label as shown below. To do so, follow the below steps.
PowerApps find record in collection
PowerApps find record in collection

Step – 1:

First, you need to create the PowerApps collection on the screen’s OnVisible property as:

OnVisible = Collect(
    colBookInfo,
    'Book Purchase Info'
)

Where,

  1. colBookInfo = Specify the collection name
  2. Book Purchase Info‘ = Specify the SharePoint list or table name from where you want to store the records in the collection
Power Apps find record in collection
Power Apps find record in collection

Step – 2:

Add a Data table control and set the created collection on its Items property as:

Items = colBookInfo

Also, you need to add the required fields (that you want to view) to the data table.

find a record in PowerApps collection
find a record in PowerApps collection

Step – 3:

Next, Add a Button input (Retrieve Value) and apply the below code on its OnSelect property as:

OnSelect = ClearCollect(
    RetrievedCollection,
    Remove(
        FirstN(
            colBookInfo,
            2
        ),
        FirstN(
            colBookInfo,
            1
        )
    )
)

Where,

  1. RetrievedCollection = Again you will create a new collection where the result will store. Specify with this collection with a different name
  2. ColBookInfo = Specify the first Collection name. As I want to view my second record, so I have specified the count value as 2 and 1.
find record in Power Apps collection

Step – 4:

At last, take a Label control and set its Text property to the below code as:

Text = "Value: " & First(RetrievedCollection).Title

Where,

  1. RetrievedCollection = Second collection name
  2. Title = Specify the field name from where you want to get the value
PowerApps collection find a record
PowerApps collection find a record

Step – 5:

Save, Publish, and Close the app. Reopen the app again and then click on the button (Retrieve Value). Once you click on it, you will view the result in the label control as shown below.

NOTE:

If you want to get the row number 3 value i.e. PowerApps Table Function (and so on), then update the below formula on Button’s OnSelect property as:

OnSelect = ClearCollect(
    RetrievedCollection,
    Remove(
        FirstN(
            colBookInfo,
            3
        ),
        FirstN(
            colBookInfo,
            2
        )
    )
)

Refer to the below screenshot.

PowerApps collection find specific record
PowerApps collection find a specific record

This is how we can find a record in the Power Apps collection.

PowerApps find space in string

Here we will discuss how to find space in the string in PowerApps. Refer to the below different scenarios.

Example – 1:

  • Here, I would like to remove all the spaces in my specified string. For example, I have a Text input control and a Label control in the app.
  • When a user will enter a string (with spaces) in the text box, then the result will appear without any spaces in the label control as shown below.
PowerApps find space in string
PowerApps find space in string
  • To do so, we will use PowerApps Substitute function. Select the label control and set its Text property to the below code:
Text = Substitute(
    txtEnterName,
    " ",
    ""
)

Where,

  1. txtEnterName = Specify the text input control name. Also, you can specify it as txtEnterName.Text
  2. ” “ = Enter the space that you want to substitute from the text box
Power Apps find space in string
  • Now save and preview the app. Enter a string to the text box, then you can see the result will appear without any spaces in the label control.

Example – 2:

  • Suppose you want to count the number of occurrence of the character in a Power Apps string, then in this case you can use PowerApps CountRows function.
  • Select the label control and apply the below code on its Text property as:
Text = "Total number of Spaces: " & CountRows(
    MatchAll(
        txtEnterName.Text,
        " "
    )
)

Where,

  1. Total number of Spaces: ” = This is the string that will display in the label control
  2. CountRows = PowedrApps CountRows function helps to count the total number of items
  3. txtEnterName = Text input control name
PowerApps find spaces in a string
PowerApps find spaces in a string
  • As my specified string contains total four number of spaces, so the result appeared as 4 in the label control as shown in the above screenshot.

To read more details about this topic, refer to this PowerApps tutorial: PowerApps find space in string

So these are some simple scenarios to find the spaces in the PowerApps string.

PowerApps find tenant id

Suppose you want to find the customer tenant id, then you may search it through the Azure portal or SharePoint. But if I will tell you to search it in PowerApps only, then from where you will find it?

So there are two ways where you can find the tenant Id in PowerApps. These are:

  1. Once you will login to PowerApps, go to the Home option from the left navigation. On the top of the Site URL bar, you can see the tenant Id after /Default portion as shown below.
PowerApps find tenant id
PowerApps find tenant id

2. Also, you can get the tenant Id from the Session details in PowerApps. Go to the Gear or Settings icon -> Session details. When you will click on it, you can see Tenant ID including all the details like Session ID, Timestamp, Object ID, etc.

Power Apps get tenant id
Power Apps get tenant id

Hence these are the different ways to check the tenant id in PowerApps.

Read: You don’t have permission to view this data error in PowerApps

PowerApps find unused variable

Now we will see how we can remove unused variable in PowerApps.

  • Suppose in the app, there are some variables that are really unused or unnecessary. So in this case, you want to remove it from the app. Once you will remove it, then you can not use those variables further.
  • To remove the unused variables from the app, go to the View tab -> click on Variables as like below screenshot.
PowerApps find unused variable
PowerApps find unused variable
  • Next, click on the variable name that you want to remove and then go to Uses option. Here you can see all the formulas that you used in the app.
  • When you will click on any variable, then it will directly go to that specific place where it presents. Then remove the formula from all the places. Once it is removed, the variable will no longer be visible in the Variables tab.
Power Apps find unused variable

This is how we can work with PowerApps to find the unused variables.

PowerApps find value in sharepoint list

In PowerApps, do you want to find the value in SharePoint list? Refer to this complete guide PowerApps SharePoint Lookup Column to achieve this thing.

Also, you may like the below PowerApps Tutorials:

This PowerApps tutorial explains what is the PowerApps Find function, and what is its syntax. Also, by taking some different scenarios, we discussed how to find and replace in PowerApps, how to find duplicates in gallery in PowerApps and many more like these below:

  • PowerApps find max value in column
  • PowerApps find and replace text
  • PowerApps find where a variable is used
  • PowerApps find meeting times
  • PowerApps find a record
  • PowerApps advanced find
  • PowerApps find user by email
  • PowerApps find user by id
  • PowerApps find user by name
  • PowerApps combobox find items
  • PowerApps can’t find sharepoint list
  • PowerApps find data source
  • PowerApps dropdown find items
  • PowerApps didn’t find that file
  • PowerApps find first day of week
  • PowerApps find email from name
  • PowerApps find filter
  • PowerApps find last item in gallery
  • PowerApps find group id
  • PowerApps find highest value
  • PowerApps find item in sharepoint list
  • PowerApps if find
  • PowerApps find largest number
  • PowerApps find length of string
  • PowerApps find user manager
  • PowerApps find max value in collection
  • PowerApps find max date
  • PowerApps find exact match
  • PowerApps find number in string
  • PowerApps quick find view
  • PowerApps find record in collection
  • PowerApps find space in string
  • PowerApps find value in sharepoint list
>