I am conditionally showing additional form fields in a grid in a dynamic form using javascript. Therefore, if I have a switch with the Yes / No options, Yes will display the grid (using <div id="whatever"> ) with additional questions, and No will not display the grid.
Now, sending E-Mail through the workflow, I would like to determine whether or not to show any answers depending on which option is Yes / No in a dynamic form. Thus, if βNoβ is selected, then there are no answers to these additional questions, and therefore, E-Mail will not display them; whereas if βYesβ is selected, these questions are displayed in the E-Mail Activity along with the answers entered by the user.
But I'm at a dead end on how to do this.
I started to understand using Activity Activity, especially Workflow.SetState(); by setting {Shape.Execute:Shape1} to a variable, but just passed a literal string instead of executing the form.
Here is my decision action code:
var choice = "#{FormSubmission.Field:RadioChoice}"; var choiceDisplay = ""; if (choice == "Yes") choiceDisplay = "{Shape.Execute:Shape1}"; else if (choice == "No") choiceDisplay = "{Shape.Execute:Shape2}"; Workflow.SetState("InsertShape", choiceDisplay); SetOutcome("Done");
And this is how I use it in E-Mail Activity:
{Workflow.State:SetState}
I'm not sure this will even work. Any recommendations are appreciated.
If so, this will not work, how can I do this?
source share