cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GeekAlf_Pro
Helper V
Helper V

API for cities

Hello,

 

in my application, i want to avoid erros in typing cities' names

So my question is there a city api that allows users to select the city istead of typing it ?

 

the other way is, i guess, to upload a file with the 36 000 cities' names directly in my application.

thanks

2 ACCEPTED SOLUTIONS

Accepted Solutions
rsaikrishna
Community Champion
Community Champion

@GeekAlf_Pro 

 

Due to limitations on the max number of values in DropDown and ComboBox controls, you can store city values in Excel file or SharePoint List or SQL Table and then provide a search box on the form for the users to search and select appropriate City name as shown below:

rsaikrishna_0-1640695834482.png

Search works fine for any number of items.

 

I hope this workaround helps you.

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

 

View solution in original post

v-bofeng-msft
Community Support
Community Support

Hi @GeekAlf_Pro :

You can try this way to check if the city name is entered correctly:

1\Add a BingMaps connection

vbofengmsft_2-1640834906407.png

 

2\Try this formula:

!IsBlank(BingMaps.GetLocationByAddress({locality:"CityName"}).address.countryRegion)

I've made a test for your reference:

If the city name is right,it will return true

vbofengmsft_0-1640834800505.png

If the city name is right,it will return false

vbofengmsft_1-1640834851032.png

Best Regards,

Bof

 

 

View solution in original post

5 REPLIES 5
rsaikrishna
Community Champion
Community Champion

@GeekAlf_Pro 

 

Due to limitations on the max number of values in DropDown and ComboBox controls, you can store city values in Excel file or SharePoint List or SQL Table and then provide a search box on the form for the users to search and select appropriate City name as shown below:

rsaikrishna_0-1640695834482.png

Search works fine for any number of items.

 

I hope this workaround helps you.

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

 

GeekAlf_Pro
Helper V
Helper V

Thanks @rsaikrishna 

 

i've already thought about an sql table, but my purpose is to have an up-to-date list.

that's why i'm looking for an api.

 

but this workaround is a solution.

 

v-bofeng-msft
Community Support
Community Support

Hi @GeekAlf_Pro :

You can try this way to check if the city name is entered correctly:

1\Add a BingMaps connection

vbofengmsft_2-1640834906407.png

 

2\Try this formula:

!IsBlank(BingMaps.GetLocationByAddress({locality:"CityName"}).address.countryRegion)

I've made a test for your reference:

If the city name is right,it will return true

vbofengmsft_0-1640834800505.png

If the city name is right,it will return false

vbofengmsft_1-1640834851032.png

Best Regards,

Bof

 

 

GeekAlf_Pro
Helper V
Helper V

Hello @v-bofeng-msft 

 

Thanks a lot, i will try very soon your solution.

 

have a good day

GeekAlf_Pro
Helper V
Helper V

Hello,

 

Your solution works fine,

Thanks

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (4,350)