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
4541 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
Parents
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
Reply
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
Children
No Data