Skip to main content


Copilot Studio - General

PVA automatically decide the closest location

Posted on by 184

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!







  • Pstork1 Profile Picture
    Pstork1 63,075 on at
    Re: PVA automatically decide the closest location

    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.

  • HenryJammes Profile Picture
    HenryJammes on at
    Re: PVA automatically decide the closest location

    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

  • nhtkid Profile Picture
    nhtkid 184 on at
    Re: PVA automatically decide the closest location

    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.



  • Pstork1 Profile Picture
    Pstork1 63,075 on at
    Re: PVA automatically decide the closest location

    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 (

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Getting Started…

Welcome to the Power Platform Community! We appreciate your visit…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…


WarrenBelz Profile Picture

WarrenBelz 138,016

RandyHayes Profile Picture

RandyHayes 76,308

Pstork1 Profile Picture

Pstork1 63,075