Showing results for 
Search instead for 
Did you mean: 
Helper I
Helper I

PVA automatically decide the closest location

Hi Fam,


I am building a PVA chatbot for a grocery chain store. 


One of the features we want to deliver is store opening hours. 


This is the scenario:


Customer: Opening Hours

Bot: Please provide your suburb or postcode

Customer: provide the suburb or the postcode

Bot: Return the closest store location base on above customer input

Customer: select a store location

Bot: Return the opening hours


So in the backend, I think I need to prepare two datasets.

All suburb dataset will have a list of all suburbs and postcodes in the country.

All store dataset will have a list of all stores, opening hours with their detailed location, including suburb and postcodes.


My question is, how does the PVA work out what's the closest location to the customer.

Has anyone got examples on how to implement this?

How does the bot handle the error?


For example, if the customer has provided a suburb name or postcode that are not in the All-Suburb dataset, or a typo, then the bot shall follow up with a different question, like "I cannot locate your suburb, please provide your state". And then the Bot will just return all stores in that state.


Hope this is quite a common scenario for a retail bot.


Thank you very much!







Dual Super User
Dual Super User

I think you have two options here.  

1) Provide an exhaustive data set that cross references all the postal codes and suburb names with the stores.

2) Use something like Bing Maps to calculate the difference between a user's current location and stores that might be close.  Take a look at the answer to this post for how to do that. Solved: Bing maps: Calculate distance between 2 waypoints ... - Power Platform Community (microsoft....

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Thanks @Pstork1 for your quick reply.

Let me do some digging.


I thought this type of function would've been so basic that any Chatbot solution shall have it built in.


- Customer asks for store location and business hours

- Bot asks back the customer's location

- Customer replies with location

- Bot returns the closest store with relevant info


Isn't that a very common scenario for building any type of retail bot?

I am very surprised there is no native solution from PVA.




I don't know how native this is in other chatbot solutions, but I like the idea.

Although it sounds simple, this requires understanding the user location (today we can easily identify these using a number of out-of-the-box entities like city or street address, but we'd also need their associated latitude / longitude coordinates) and then crosscheck in another data source the closest stores to these latitude / longitude coordinates.

Where would you imagine storing your list of stores and their location @nhtkid

PVA is a framework for building bots using low code/no code.  So other than the AI support for interpreting user input there is very little in the way of native functionality to process the user's inputs.  That is all done using Power Automate flows, which are very extensible and have hundreds of connectors for various data types.  Using Bing Maps via a flow in this scenario is a pretty standard approach for PVA.

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Power Virtual Agents News & Announcements

Power Virtual Agents News & Announcements

Keep up to date with current events and community announcements in the Power Virtual Agents community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Virtual Agents Community Blog

Power Virtual Agents Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (4,091)