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
5 replies
Subscribers
7 subscribers
Views
4538 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
I have a form which has multi select field.(drop down box allowing multiple sele
raghunandanj3904
Certified Senior Developer
over 12 years ago
I have a form which has multi select field.(drop down box allowing multiple select).
In the field i am populating a list of countries, fetched from the DB. The DB table has anothr column riskVal against each country.
Now when i multiselect the countries in the form, i need to get the associted riskVal values. i ,e if the user selects 5 countries, i need to get the 5 riskVal associated to the country. Actual req is sum of all the selected countries risk.
My query rule is already fetchin all the data for both columns. I need suggestion on how to get the values in this case....
OriginalPostID-61702
OriginalPostID-61702
Discussion posts and replies are publicly visible
0
akhilan
over 12 years ago
You can use the displayValue() function to look up the value in the riskVal array for each country selected. This has to be used in conjuction with looping functions.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
raghunandanj3904
Certified Senior Developer
over 12 years ago
Can you be a bit more elaborative pls??
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
akhilan
over 12 years ago
Here are the links to the functions -
forum.appian.com/.../Conversion_Functions
forum.appian.com/.../Looping_Functions
The above should be of help.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Bishnu Panigrahi
Appian Employee
over 12 years ago
This is a sample expression Akhila is referring to:
apply(fn!displayvalue,ri!countriesSelectedFromDropdown,ri!countriesList,ri!riskValsList,"Unknown")
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Annelise Dubrovsky
Appian Employee
over 12 years ago
An alternative idea is to use the index() and sum() functions, and pass an array as the second parameter: sum(index(ac!allCountries, ac!selectedCountries, 0).riskVal)
forum.appian.com/.../Array_Functions
When configuring the dropdown, set the value to be
=1+enumerate(length(ac!allCountries))
Where ac!allCountries is a node input of type country. This contains the result of the query rule that returns all countries from the DB.
The dropdown would save its values into a node input called "selectedCountries".
You would write your final expression in a custom node output, and save the result in a PV. The result will be the sum of all riskVal associated with the selected countries.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel