cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Use Bing/Google autocomplete/Geocoding in PowerApp (inputform)

Hi All,

 

I would like to have a datacard/text box that when i start to type in an address autocompletes it (shows the available options) like for ex in google maps. I saw that the functionality is available in API for Google (and i think also for Bing).

 

But how to incorporate it in the datacard/textbox?

 

Any idea?? Thx in advance!!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Use Bing/Google autocomplete/Geocoding in PowerApp (inputform)

Hi @OliverV ,

Do you want to auto-complete the address when you type it within a Text box in your app?

 

If you want to auto-complete the address when you type it within a Text box in your app, I afraid that there is no way to achieve your needs in PowerApps currently.

 

As an alternative solution, I think the combination of PowerApps and Power Automate based on Bing Map Autosuggest REST API could achieve your needs.

 

The flow's configuration as below:

8.JPG

 

9.JPG

Within the "HTTP" action, Uri field set to following:

 

http://dev.virtualearth.net/REST/v1/Autosuggest?query=@{triggerBody()['Query_Inputs']}&userLocation=@{triggerBody()['UserLocation_Inputs']}&key=Aqixt5_5AIqykNsSBPhhBZnhmunCd1Dy4dc6yRjhPSc8PQGIpnrjU3NoewIulDUN

 

Within the "Select" action, Input field set to following:

 

body('HTTP')?['resourceSets'][0]?['resources'][0]?['value']

 

in Map field, add two fields, and the corresponding value set to following:

 

item()?['address']?['countryRegion']
item()?['address']?['formattedAddress']

 

Within "Response" action, Response Body JSON field set to following:

 

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "Country": {
                "type": "string"
            },
            "Address": {
                "type": "string"
            }
        },
        "required": [
            "Country",
            "Address"
        ]
    }
}

 

Body field set to Output dynamic content of the "Select" action.

 

App's configuration:

10.JPG

Add Text Input box, Search Icon, List box in your app. Then bind the Search Icon with the Flow created above (Firstly, you need to add above flow connection into your app).

Set the OnSelect property of Search Icon to following:

 

ClearCollect(AddressCollection, 'BingMapAddressAuto-Complete'.Run(TextInput1.Text, Location.Latitude&","&Location.Longitude));Set(ShowList, true)

 

 

Set the Default property of Text Input box to following:

 

If(!IsBlank(ListBox1.Selected.Value), ListBox1.Selected.Value)

 

 

Set the Items property of List Box to following:

 

ForAll(AddressCollection, Address & "," & Country)

 

set the Visible property of List box to following:

 

ShowList

 

set the OnSelect property of List Box to following:

 

Set(ShowList, false)

 

 

Please check the following GIF screenshot for more details:

Test.gif

Please check the attached sample app for more details.

 

In addition, you could also consider create a custom connector based on the Bing Map Autosuggest REST API.  Then you could use the custom connector to retrieve data from the Bing Map API.

Create a custom connector in PowerApps

https://www.youtube.com/watch?v=dBCS1nPsDiE

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Helper I
Helper I

Re: Use Bing/Google autocomplete/Geocoding in PowerApp (inputform)

@WarrenBelz  By any chance, do you have a workaround?

Highlighted
Community Support
Community Support

Re: Use Bing/Google autocomplete/Geocoding in PowerApp (inputform)

Hi @OliverV ,

Do you want to auto-complete the address when you type it within a Text box in your app?

 

If you want to auto-complete the address when you type it within a Text box in your app, I afraid that there is no way to achieve your needs in PowerApps currently.

 

As an alternative solution, I think the combination of PowerApps and Power Automate based on Bing Map Autosuggest REST API could achieve your needs.

 

The flow's configuration as below:

8.JPG

 

9.JPG

Within the "HTTP" action, Uri field set to following:

 

http://dev.virtualearth.net/REST/v1/Autosuggest?query=@{triggerBody()['Query_Inputs']}&userLocation=@{triggerBody()['UserLocation_Inputs']}&key=Aqixt5_5AIqykNsSBPhhBZnhmunCd1Dy4dc6yRjhPSc8PQGIpnrjU3NoewIulDUN

 

Within the "Select" action, Input field set to following:

 

body('HTTP')?['resourceSets'][0]?['resources'][0]?['value']

 

in Map field, add two fields, and the corresponding value set to following:

 

item()?['address']?['countryRegion']
item()?['address']?['formattedAddress']

 

Within "Response" action, Response Body JSON field set to following:

 

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "Country": {
                "type": "string"
            },
            "Address": {
                "type": "string"
            }
        },
        "required": [
            "Country",
            "Address"
        ]
    }
}

 

Body field set to Output dynamic content of the "Select" action.

 

App's configuration:

10.JPG

Add Text Input box, Search Icon, List box in your app. Then bind the Search Icon with the Flow created above (Firstly, you need to add above flow connection into your app).

Set the OnSelect property of Search Icon to following:

 

ClearCollect(AddressCollection, 'BingMapAddressAuto-Complete'.Run(TextInput1.Text, Location.Latitude&","&Location.Longitude));Set(ShowList, true)

 

 

Set the Default property of Text Input box to following:

 

If(!IsBlank(ListBox1.Selected.Value), ListBox1.Selected.Value)

 

 

Set the Items property of List Box to following:

 

ForAll(AddressCollection, Address & "," & Country)

 

set the Visible property of List box to following:

 

ShowList

 

set the OnSelect property of List Box to following:

 

Set(ShowList, false)

 

 

Please check the following GIF screenshot for more details:

Test.gif

Please check the attached sample app for more details.

 

In addition, you could also consider create a custom connector based on the Bing Map Autosuggest REST API.  Then you could use the custom connector to retrieve data from the Bing Map API.

Create a custom connector in PowerApps

https://www.youtube.com/watch?v=dBCS1nPsDiE

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Helper I
Helper I

Re: Use Bing/Google autocomplete/Geocoding in PowerApp (inputform)

Hello @v-xida-msft ,

 

I'm having some minor troubles with the implementation of the solution from you written:

 

1) still in the flow section the last line that you wrote: "Body field set to Output dynamic content of the "Select" action." where should i do it???

 

2) my final result seems to have a different sintax 

Mine

mine.jpg

yours

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,237)