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
9 replies
Subscribers
7 subscribers
Views
6704 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Multiple dropdowns with duplicate values
ashokv
A Score Level 1
over 7 years ago
Hi All.
I'm trying to create an editable grid with 4 dropdown component. The values of the dropdown are populated by query rules. Based on the value of the dropdown selected in the first dropdown, the values in the second dropdown should be populated. The issue I'm facing here is if there are any duplicate values in 1st dropdown, its throwing an error. But if you combine together both dropdown1 and dropdown2 they are unique.
Ex: Dropdown1 dropdown 2
Fruits Apple
Fruits Oranges.
So, when I try to retrieve these values from DB and display in editable grid, it is throwing an error regarding duplicate values in dropdown1. But this error is not consistent as it is displaying without any issues sometimes.
Any suggestions
OriginalPostID-245812
Discussion posts and replies are publicly visible
0
Conor Cahill
Certified Lead Developer
over 7 years ago
You could modify your queries to group by the values in dropdown1. Then "Fruits" would only appear once, and then once that is selected, the dropdown2 field could be populated with {"Apple","Oranges"}
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
bhanuprakashm
over 7 years ago
@ashokv,
Tel me one thing, you are populated second dropdown based on first dropdown values means primary id or unique text. if it is unique text use union in the first dropdown and then fetch the values in second..
hope it will help to you
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Krishna Chaitanya
A Score Level 1
over 7 years ago
@ashokv
Duplicate items are not allowed in the choiceValues,so use primary key or unique text to populate first dropdown based on first dropdown value populate second dropdown.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Krishna Chaitanya
A Score Level 1
over 7 years ago
@ashokv
one more way is use "aggregation" in queryEntity
a!queryEntity(
entity:cons!FRUIT_ENTITY,
query:
a!query(
aggregation:a!queryAggregation(
aggregationColumns:
a!queryAggregationColumn(
field:"Fruits",
isGrouping :true
)
)
,
pagingInfo:a!pagingInfo(startIndex: 1,
batchSize: -1)
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Shashank
over 7 years ago
@ashokv
Hi ,
as @Bhanu and @KChaitanya suggested you can have two dropdown fields , with conditional data i.e, in the first dropdown , you can get all the categories ( in your case ) and based on that category , you can use the grouping query suggested to get the values of the second dropdown
You can use the union() function for the elements on the first dropdown , to get only unique elements and please make sure that you store the proper id , so as to filter the data for that particular category from the query
Thanks
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
ashokv
A Score Level 1
over 7 years ago
Thank you all for the help. I forgot to use union function. The issue is fixed now
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
vinays505
over 7 years ago
@ashokv Can you send me the sail code that how you populate second dropdown on the basis of selection of first dropdown, ignoring that unique & duplicate problem in the dropdown
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Krishna Chaitanya
A Score Level 1
over 7 years ago
Hi @vinays505
forum.appian.com/.../recipe_configure_cascading_dropdowns.html
Hope it will help you..
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
vinays505
over 7 years ago
Thanks Man
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel