This blog post is related to Adobe Campaign Web applications and addresses the Use Case where we need to apply business logic on multiple options selected in multiple choice field in Survey app using SCORE attribute.
A simple and easily maintainable solution to the problem is SCORE attribute. The “SCORE” attribute can be assigned to each option during Page configuration itself which can later be used in following transitions to drive the business logic.
In order to illustrate this, let’s consider a form which capture the type of Vehicle user owns with multiple selection available and we need to drive to a conclusion that whether user owns Truck or SUV among options like Bicycle, Bike, Car, SUV and Truck.
Create a new Survey app at location Resources > Online > Web applications
We are creating the below workflow in this survey app where Vehicle Choice page contains the multiple select field with score assigned to each option. Based on cumulative score of the options selected with would be drive our filters and hence the business logic.
Add “Multiple choice” type control and make sure “Multiple values” checkbox is selected to get the required behavior. By doing this Storage archived field gets associated to the control.
Now, add options to the Multiple choice field (vehicles is our case here) and assign the Score to each field.
So, now we have assigned score to each option. Whatever options we selected, the cumulative score gets passed on to the next transition and based on its (@score) value we can implement the filters and test conditions.
Preview the application to see the results.
Note: the value of @score here and the options selected.
Code snippet for above demo app is available at location https://bitbucket.org/snippets/dhirsachin/5eLon#file-SurveyApp.xml