Message Boards Message Boards

1
|
11727 Views
|
4 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Need examples of multipage FormFunction[]

POSTED BY: Truly Unique
4 Replies
POSTED BY: Truly Unique
POSTED BY: Chad Knutson

Thank you, Chad! I would still like to explore the multipage FormFunction[] options to get a "clean" solution. The Wolfram Programming Cloud documentation says:

FormFunction[{formspec1,formspec2,…},func,…] represents a multipage form, in which the successive formspec_i can be functions that are applied to the values obtained so far.

I wonder if you could give me an example, illustrating the above statement.

Thanks in advance, Stas

POSTED BY: Truly Unique

Stas, apologies for the slow response. I was trying to think of ways that this can be done, but I don't think it is possible. UPDATE: Very possible. See my reply below.

An alternative solution would be to use separate FormFunctions. but this is not nearly as "clean". Here is a trivial example.

a2 = CloudDeploy[ FormFunction[{"x" -> {"cat", "person"}}, 
   Switch[#x, "cat", HTTPRedirect[First@cat], "person", HTTPRedirect[First@person]] &]]

Where I have previously defined (and deployed) the secondary forms:

cat = CloudDeploy[FormFunction[{"x" -> "CatBreed"}, #x["Image"] &, "PNG"]]

and

person = CloudDeploy[FormFunction[{"person" -> "Person"}, #person["BirthDate"] &]]
POSTED BY: Chad Knutson
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