Message Boards Message Boards

Problems interpreting Location type in Wolfram Cloud Form

Posted 4 months ago

me again. ;-)

I having an issue creating a web form that I want to use for people to submit messages with a location whenever they find an item that I've left behind.

I have the following code for the form, which you can try:

CloudDeploy@FormFunction[
 {
  "Your Location" -> <|"Required" -> True, 
    "Interpreter" -> "Location", 
    "Input" :> Here["LatitudeLongitude"]|>,
  "Your Name" -> <| "Required" -> True, "Interpreter" -> "String"|>,
  "Phone Number" -> <|"Required" -> False, 
    "Interpreter" -> "PhoneNumber"|>,
  "Email" -> <|"Required" -> True, "Interpreter" -> "EmailAddress"|>,
  "Message" -> <|"Required" -> False, "Interpreter" -> "String"|>
  }

The "Your Location" field automatically is filled in with the device location as {lat,lng} (with values for the lat and lng, of course). However, when submitting the form, it returns the error message, "No geographic coordinates [or location] interpretation found. Try again." on that field.

What am I doing wrong? I've reviewed the documentation here, but it's not working with the particular function I'm using for the prefill, which is Here["LatitudeLongitude"].

I have also tried "Location", "ComputedLocation", "GeoCoordinates", and "GeoPosition" as values for Interpreter.

POSTED BY: Steven Buehler
Posted 4 months ago

Solved my own problem with the following after a bunch of trial and error. As much as love Wolfram some of the ways it does things are strange to me. :-)

"Your Location" -> <|"Required" -> True, 
  "Interpreter" -> "GeoCoordinates", 
  "Input" :> 
   ToString@Here["Latitude"] <> "," <> ToString@Here["Longitude"]|>
POSTED BY: Steven Buehler
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract