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
20 replies
Subscribers
11 subscribers
Views
10561 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Data and Records
Can we add two or more filters in facetOption
ramakg
A Score Level 1
over 7 years ago
Can we add two or more filters in facetOption? if not, is there any workaround solution?
a!facet(
name : "Status",
options : {
a!facetOption(
id : 1,
name : "Active",
filter : {
a!queryFilter(
field:"StartDate",
operator:"<=",
value: today()
),
a!queryFilter(
field:"EndDate",
operator:">=",
value: today()
)
}
)
},
defaultOption: "Active"
)
OriginalPostID-240150
Discussion posts and replies are publicly visible
0
venkateshs329
over 7 years ago
#Below example code for Reference
statusFilterOption:
------------------
a!facetOption(
id: ri!id,
name: ri!status,
filter: a!queryFilter(
field: "status",
operator: "=",
value: ri!status
)
)
a!facet(
name: "Status",
options: apply(
rule!statusFilterOption,
merge(enumerate(count(cons!ISSUE_STATUSES))+1, cons!ISSUE_STATUSES)
)
isVisible: true
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
ramakg
A Score Level 1
over 7 years ago
Thank you sikhivahans
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 7 years ago
@ramakg Also just to let you know, the a!queryLogicalExpression() as suggested above isn't an option because afaik it isn't a function that can be used in the User Filters section. And the above-mentioned example which creates a rule and iterates it over a set of statuses defies the requirement as it ends up in creating multiple facet options as opposed to your thoughts of getting the job done with a single facet option.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
ramakg
A Score Level 1
over 7 years ago
@sikhivahans, Small query. I will not get the data if I unselect the facet option, if I use these filters while fetching the data itself.
in general, by default fetch all the records and then apply the required filters.
Any comments?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 7 years ago
@ramakg Sorry, I am really not clear about the requirement. Would you be able to let me know how your current implementation(at a very high level) is and what you are expecting on top of it?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
ramakg
A Score Level 1
over 7 years ago
record is pulling required data. for the default filter, I want to apply the two or more conditions for example.
startdate <=today() and enddate>=today() and so on...
I think, 2nd option(creating view) is only the feasible solution for my requirement.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 7 years ago
@ramakg If it's two different fields and the operator between them is 'AND' why would you need a view? As your requirement is to add "Default Filters", you may straight away proceed with adding the two default filters, with one field per default filter, operators as >=/>= and values as today(). Let me know if you have any specific requirement so that we can see what fits the best in your case.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
bhanuprakashm
over 7 years ago
@ramakg, Please refer the below link for your query.
hope it will help you
forum.appian.com/.../Expression-Based_User_Filters.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
ramakg
A Score Level 1
over 7 years ago
I have achieved by using view. Thank you for all your support.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
davidg707
over 7 years ago
Try creating a facetoption rule and applying over it in the a!facet()
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
<