2
$\begingroup$

What is wrong with this code:

CloudDeploy[FormFunction[{"Number1"->"Number","Number2"->"Number"},
                         If[#Number1/#Number2<=0.5,"True","False"]]]

It gives back the following error:

Function::slot1: (CloudObjectPrivatesetCloudIcon[Last[#1],CloudObjectPrivatecloud$15017,CloudObject`Private`uuid$15017,First[#1],\[Ellipsis] t-><<37>>,Deployment->CloudObjectPrivatedeployment$15017,Asynchronous->True,Content->FormFunction[Number1 Number2 ,If[Slot[<<1>>] Power[<<2>>]<=0.5,True,False]],Deployment->WebForm]&)[<<1>>] is expected to have an Association as the first argument.

$\endgroup$
2
  • $\begingroup$ Welcome to Mathematica.SE! I suggest that: 1) You take the introductory Tour now! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! 3) As you receive help, try to give it too, by answering questions in your area of expertise. $\endgroup$
    – bbgodfrey
    Commented Feb 24, 2015 at 19:56
  • $\begingroup$ Please write a title that has something to do with the content of your question and will help future questioners find the answer from your title. $\endgroup$ Commented Feb 24, 2015 at 20:06

1 Answer 1

4
$\begingroup$

use postfix & pure function or fullform pure Function.

CloudDeploy[
  FormFunction[
    {"Number1" -> "Number", "Number2" -> "Number"}, 
    If[#Number1/#Number2 <= 0.5, "True", "False"] &
  ]
]

CloudDeploy[
  FormFunction[
    {"Number1" -> "Number", "Number2" -> "Number"}, 
    Function[If[#Number1/#Number2 <= 0.5, "True", "False"]]
  ]
]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.