Message Boards Message Boards

0
|
4388 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Does the URL Redirect Example from FormFunction work correctly?

Posted 10 years ago

When I tried the first example from FormFunction, Neat Examples it only worked once (for Wikipedia) and after that it always gave an error result (for example on Google or Wolfram Research). The example is:

CloudDeploy[
 FormFunction[{"Website" -> <|"Interpreter" -> "SemanticURL", 
     "Input" -> "Wikipedia"|>}, Composition[HTTPRedirect, First], 
  AppearanceRules -> <|"Title" -> "WebGo!", 
    "Description" -> 
     "Write the name of any website, and we will take you there!", 
    "SubmitLabel" -> "Go!"|>]]

Even after closing the web page, and regenerating the CloudDeploy link, giving a new link, I could only obtain the error page. I could not even obtain the input form.

2 Replies

That was likely a temporary bug with HTTPRedirect. That code seems to be working now. However, I would suggest editing it to use the name of the input variable. I think much easier to read/understand:

CloudDeploy[
 FormFunction[{"Website" -> <|"Interpreter" -> "SemanticURL", "Input" -> "Wikipedia"|>}, 
  HTTPRedirect[#Website] &, 
  AppearanceRules -> <|"Title" -> "WebGo!", 
    "Description" -> "Write the name of any website, and we will take you there!", 
    "SubmitLabel" -> "Go!"|>]]
POSTED BY: Chad Knutson

I tried it with both the link in the docs and a newly-deployed one, and it worked fine. Could you post a picture of the error message?


By the way, I like WebGo. Much catchier than Google, don't you think?

POSTED BY: Jesse Friedman
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