Message Boards Message Boards

Cloud Deploy a FormFunction

Posted 11 years ago

Hello!:)

I am trying to deploy a form function that takes two numbers, a basis and an exponent, and computes basis^exponent.

CloudDeploy[
 FormFunction[{"basis" -> "Number", "exponent" -> "Number"}, 
  f[basis, exponent]]]

The output for 3 and 2 is (basis^exponent)[<|"basis" -> 3, "exponent" -> 2|>] instead of 9.

Any hints?

Thanks!:)

POSTED BY: Radu Matei
Posted 11 years ago

seems you just copied the lines somewhere and don't know what f means here.
well, it should be a pure funtion object, please reference to ref/Function

CloudDeploy[
 FormFunction[{"basis" -> <|"Interpreter" -> "Number", "Input" :> 3|>,
    "exponent" -> <|"Interpreter" -> "Number", "Input" :> 2|>}, 
  #basis^#exponent &, 
  AppearanceRules -> <|"Title" -> "demo power function", 
    "Description" -> "Enter two number as prompted below"|>, 
  FormTheme -> "Red"]]

good luck.

POSTED BY: wayne wang
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