Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
6 replies
Subscribers
7 subscribers
Views
2112 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
We have a form with about 6 select boxes. Scenario is: on selection of the optio
raghunandanj3904
Certified Senior Developer
over 11 years ago
We have a form with about 6 select boxes. Scenario is: on selection of the options in the select box, a value needs to be captured and stored. For eg: in select box 1, if i select option 2 then value 2 to be stored and so on. When form is submitted, i neeed to have the sum of all the values in an integer variable and also an array with the selected values. Eg my final integer value is 28 (which is added up) and array is {2,4,6,8,2,6} somethin like this.
I dont wanna have n number of hidden fields for n number of select boxes. If i have only 1 filed and if i want to keep dding the values to the same then on which event i can do this?? cos, onChange event will keep adding everytime i change the value. onoutfocus is not there.
onSubmit if I try to do this, then again if there are many select boxes, the scripting will b huge.
If someone can suggest the best approach would be helpful.
One more thing, in the output tab of data if I try to add the value to ...
OriginalPostID-60267
OriginalPostID-60267
Discussion posts and replies are publicly visible
0
raghunandanj3904
Certified Senior Developer
over 11 years ago
...the pv, only the last expression's result gets stored onto the pv.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sathya Srinivasan
Appian Employee
over 11 years ago
You should be able to use the output tak to do this. For each array, you need to use the corresponding activity class parameter (for the drop down) and add this which will provide the desired output. So your output will look something like ac!firstDropDownValue + ac!secondDropDownValue ..... --> stored into ==. pv!yourOutoutVariable.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
raghunandanj3904
Certified Senior Developer
over 11 years ago
Hi Satya / Akhilan, jus correct me if i m wrong. When we set a field value thru script, doesn it gets stired into an ac! ?? Cos i notices that, on submit event of the form, i was setting a field value which vs stored onto n ac!. And in the output tab i used to store it to pv!. But never got the value at all.
So wat i did was, before submitting the form, i set the field value and made it mandatory(it is already hidden.. :) ). then in onSubmit i checkd the value, it appears!!!
Thanks anyway for the suggestion.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
raghunandanj3904
Certified Senior Developer
over 11 years ago
stired* = stored.. Sorry typo
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sathya Srinivasan
Appian Employee
over 11 years ago
yes, when you populate a field, the value gets stored in the PV! only when the form is submitted. You will be able to access the value using the Data-->Output tab of the User Input Task. The is set past onSubmit. Perhaps that's why you are not able to get the value.
Unless essential, I'd recommend avoiding JS and using the Data-Output to do the calculations. (and, its Sathya)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
raghunandanj3904
Certified Senior Developer
over 11 years ago
Yeah Sathya.. Now trying not to use much of JS.. And moreover, we cant capture events like outfocus or onBeforeSubmit etc.. So goin on with the OOTB fucntionalities.. Having to ave multiple hidden fields, as its scope will be o the form submission and once done ac! s are dead. So its ok to have more of ac!'s. Correct me if I am wrong.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel