I have a form which has multi select field.(drop down box allowing multiple sele

Certified Senior Developer
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
  • 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.
Reply
  • 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.
Children
No Data