When a user sends their location, WhatsApp shares latitude & longitude as coordinates.
User query received in Dialogflow on behalf of the user is in following format -
location:{{Latitude}},{{Longitude}}
e.g. - location:28.502241,77.0841821
How to Capture Location Type User Query
Step 1 : Create Regular Expression Entity
Use this as regex - ^location:(-?\d+(\.\d+)?),*(-?\d+(\.\d+)?)$
Step 2: Create a New Intent
-
Give it a name
-
In training phrase put this as example - location:28.502241,77.0841821
-
Map @Location entity to it
-
Create a new parameter Location
-
Use $Location in place of Value & Default Value
-
Save
-
Test your Intent