Hi All ,
I have two filters Suppose Area and Zone to filter the data Area and zone have different values both filters are drop dow
Ex - if we will select the Area value A then in Zone filter will show only Option a , b , c instead of a , b , c ,d ,e ,f and if we initiate with filter F2 Value e then it should show only option B instead of A , B.... i cant understand the logic
Discussion posts and replies are publicly visible
There were a couple of folks that responded to your other post: https://community.appian.com/discussions/f/general/17555/filter-data-issue
Did you try the methods suggested in that post? If it didn't work, can you explain what happened?
thats not working Peter ..... i need to fetch the details of reference table that is CDT ....how to fetch the field values of cdt , im able to fetch only field of cdt Ex - choiceLabels: fn!split(fn!stripwith(fn!tostring('type!{urn:com:CDT Name '()) , "=[] "),","), choiceValues:fn!split(fn!stripwith(fn!tostring('type!{}CDT Name'()) , "=[] "),",")
Do you want to get the field names (e.g. group, product, area, zone) or do you want to get the field values (e.g. A, B, a, b, c)? The expression you have above will get the field names, which I don't think is going to be useful to you. Instead, you need to use a query and dot notation to return the relevant data.
For instance, use the query expression from my other comment. This should return the full query with all fields. Then, you can access the individual fields using a!queryEntity(...).data.<field name> (for instance, put area in the place where it says field name to return the area values). Then, use this as your choice labels / values within your dropdown menu.
i want to get field value
Does the above work for you then? If not, can you provide more information about what you tried and what the response is? If you're struggling with this, I would suggest creating a separate expression rule where you can test only the query expression to make sure the correct result is returned by that expression.
Peter Lewis said:There were a couple of folks that responded to your other post
Not to mention the most recent post... https://community.appian.com/discussions/f/best-practices/17564/how-to-get-cdt-field-values
Yeah, it's easier for other participants to follow if you continue on the same thread instead of opening new questions each time
Hi wapidd0001
You can have a multiple dropdown field to select multiple areas and get the index of the selected areas to fetch the respective zones. Have a look at this
load( local!cdt:{{customerName:"xyz", group:"x1", product: "p1", area:"A", zone:"a"}, {customerName:"abc", group:"x2", product: "p2", area:"A", zone:"b"}, {customerName:"mno", group:"x1", product: "p1", area:"A", zone:"c"}, {customerName:"opq", group:"x3", product: "p3", area:"B", zone:"d"}, {customerName:"qrs", group:"x4", product: "p4", area:"B", zone:"e"}, {customerName:"tre", group:"x5", product: "p6", area:"B", zone:"f"}}, local!selectedArea, local!selectedZone, local!zones, { a!sectionLayout( label:"Filter Criteria", contents: { a!multipleDropdownField( label:"Area", choiceLabels: union(local!cdt.area,local!cdt.area), choiceValues: union(local!cdt.area,local!cdt.area), placeholderLabel: "Select", value:local!selectedArea, saveInto: {local!selectedArea, a!save(local!zones, (index(local!cdt.zone, wherecontains(apply(tostring(_),local!selectedArea),apply(tostring(_),local!cdt.area)),{}))), a!save(local!selectedZone, if(contains(apply(tostring(_),local!zones),tostring(local!selectedZone)),local!selectedZone,null)) } ), if(rule!APN_isEmpty(local!selectedArea),{}, a!dropdownField( label:"Zone", choiceLabels: union(local!zones,local!zones), choiceValues: union(local!zones,local!zones), placeholderLabel: "Select", value:local!selectedZone, saveInto: local!selectedZone ) ) } ) } )