SharePoint online - PowerApps - Display relevant options while typing a city in a text box

Sherazad Ahmed 371 Reputation points
2025-03-07T20:52:24.9933333+00:00

Hello, Can someone assist me in how I can achieve pulling relevant options to choose from for cities from a list by starting to type the name of the city in a text box on SharePoint? The SharePoint form is currently being customized using PowerApps. thanks, Sherazad

thanks,

Sherazad

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,407 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Ling Zhou_MSFT 22,725 Reputation points Microsoft External Staff
    2025-03-10T06:13:36.6566667+00:00

    Hi @Sherazad Ahmed,

    Thanks for reaching out to us. We are very pleased to support you.

    Please refer to the following steps to add a drop-down list of cities:

    Step 1: Set Up Your Data Source

    Ensure you have a SharePoint list (e.g., Cities) with at least one column:

    For example, I created a Cities list and used the Title column to save the cities.

    User's image

    Step2: Customize your list in Power Apps.

    Open your SharePoint form in Power Apps studio.

    Step3: Add Cities to SharePoint form.

    Click Add data > Connectors >SharePoint >Select Cities list.

    User's image

    User's image

    Steps4: Add the Input Controls

    • Add TextInput to input city name. In my example I named it txt_city. In your environment, please replace it with your name.
    • Add Dropdown to show city list. In my example I named it drp_CityList. In your environment, please replace it with your name. User's image

    Step5: Configure the dropdown

    Set the Items property of drp_CityList to:

    Filter(Cities, StartsWith(Title, txt_city.Text))
    

    Explanation:

    • Cities: Your SharePoint Cities list.
    • Title: Name of the column that saves the city
    • StartsWith: Filters items beginning with the input text.
    • txt_city.Text: The value typed by the user.

    Set the Value Property to "Title" to show city names.

    User's image

    Set the Visible property of drp_CityList to show dropdown only when typing.

    !IsBlank(txt_city.Text)
    

    User's image

    Step6: Save the Selected City

    • Go to the OnChange property of drp_CityList and add:
    UpdateContext({selectedCity: drp_CityList.Selected.Title})
    

    User's image

    • Go to the city DataCard. Set Update property of the DataCard to:
    drp_CityList.Selected.Title
    

    User's image

    Step7: Save and publish it to SharePoint

    Here is my test result:

    User's image

    If you have any questions, please do not hesitate to contact me.

    Moreover, if the issue can be fixed successfully, please click "Accept Answer" so that we can better archive the case and the other community members who are suffering the same issue can benefit from it.

    Your kind contribution is much appreciated.

    0 comments No comments

  2. Sherazad Ahmed 371 Reputation points
    2025-03-11T14:40:15.4+00:00

    Thank you Ling for the detailed breakdown. I will give it a try and let you know.

    regards,

    Sherazad.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.