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.
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.
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.
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.
Set the Visible property of drp_CityList
to show dropdown only when typing.
!IsBlank(txt_city.Text)
Step6: Save the Selected City
- Go to the OnChange property of
drp_CityList
and add:
UpdateContext({selectedCity: drp_CityList.Selected.Title})
- Go to the city DataCard. Set Update property of the DataCard to:
drp_CityList.Selected.Title
Step7: Save and publish it to SharePoint
Here is my test result:
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.