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
10 subscribers
Views
4164 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Data and Records
Hi, How to implement multiple facets on service-backed records. For e
Durgesh
A Score Level 2
over 11 years ago
Hi,
How to implement multiple facets on service-backed records. For example, I have defined two facets, one for Title & another for Department. What will be the structure of filter query in this case (Having both the facet options selected by a user)?
Please provide any example.
Thanks...
OriginalPostID-99458
OriginalPostID-99458
Discussion posts and replies are publicly visible
0
Patty Isecke
Appian Employee
over 11 years ago
Multiple facets are applied by an AND union. If you have 2 facets: Title and Department, and say you filter by Manager and HR, the records that you will see will be any managers in the HR department.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Patty Isecke
Appian Employee
over 11 years ago
Checkout the documentation for more information and examples:
forum.appian.com/.../Record_Design
forum.appian.com/.../Records_Tutorial
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Durgesh
A Score Level 2
over 11 years ago
Thanks patty,
I understood that multiple facets will be applied as AND union. But how can i work with multiple facets to filter the records when i am dealing with Standard Appian User records?
My case is -
1) Created a rule to fetch all the appian users - 'rule!fetchUsers'
2) Created another rule which shows all the users in a listview. - 'rule!showUsers'
3) Create service-backed record by using 'rule!showUsers'.
4) This service-backed record shows me all the users in ListView.
5) Then, added 'Department' facet in 'rule!showUsers'.
6) Created another rule to actually filter the records based on department facet option selected by user. - 'rule!fetchFilteredUsers'
7) I am assuming that department Id gets passed to this 'rule!fetchFilteredUsers' Rule. Hence this works.
8) But when i add another facet option to the rule (Title). I am not able to determine as how to update filtered rule in order to achieve the functionality for both facets.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Durgesh
A Score Level 2
over 11 years ago
In forum, an example is given to work with single facet. The example illustrates change in XML file name on the basis of selected facet option. In real time, a rule should filter out the records based on the options selected.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Durgesh
A Score Level 2
over 11 years ago
My rule is -
=with(
filterValue: if(
isnull(ri!query.'logicalExpression|filter|search'),
"",
ri!query.'logicalExpression|filter|search'.value
),
usersList:
if(isnull(filterValue),
rule!ViewUsers(),
apply(rule!getOddIndexValues,rule!ViewFilteredUsers(filterValue))
),
'type!{
www.appian.com/.../2009}ListView'(
dataSubset: 'type!{
www.appian.com/.../2009}ListViewDataSubset'(
startIndex: 1,
batchSize: count(local!usersList),
totalCount: count(local!usersList),
data: apply(
rule!getUserItem,local!usersList
),
identifiers: apply(
rule!getUserIdentifier,local!usersList
)
),
facets: {
'type!{
www.appian.com/.../2009}Facet'(
name:"Department",
options:{
'type!{
www.appian.com/.../2009}FacetOption'(
id:1,
name:"CXO",
filter:'type!{
www.appian.com/.../2009}QueryFilter'(
field:"groupId",
operator:"=",
value:"1"
)
),
'type!{
www.appian.com/.../2009}FacetOption'(
id:2,
name:"BU",
filter:'type!{
www.appian.com/.../2009}QueryFilter'(
field:"groupId",
operator:"=",
value:"2"
)
),
'type!{
www.appian.com/.../2009}FacetOption'(
id:3,
name:"Finance",
filter:'type!{
www.appian.com/.../2009}QueryFilter'(
field:"groupId",
operator:"=",
value:"3"
)
),
'type!{
www.appian.com/.../2009}FacetOption'(
id:4,
name:"Human Resources",
filter:'type!{
www.appian.com/.../2009}QueryFilter'(
field:"groupId",
operator:"=",
value:"4"
)
),
'type!{
www.appian.com/.../2009}FacetOption'(
id:5,
name:"Information Technology",
filter:'type!{
www.appian.com/.../2009}QueryFilter'(
field:"groupId",
operator:"=",
value:"5"
)
)
}
),
'type!{
www.appian.com/.../2009}Facet'(
name:"Title",
options:{
'type!{
www.appian.com/.../2009}FacetOption'(
id:1,
name:"President",
filter:'type!{
www.appian.com/.../2009}QueryFilter'(
field:"titleId",
operator:"=",
value:"1"
)
),
'type!{
www.appian.com/.../2009}FacetOption'(
id:2,
name:"Vice President",
filter:'type!{
www.appian.com/.../2009}QueryFilter'(
field:"titleId",
operator:"=",
value:"2"
)
),
'type!{
www.appian.com/.../2009}FacetOption'(
id:3,
name:"Sr. Manager",
filter:'type!{
www.appian.com/.../2009}QueryFilter'(
field:"titleId",
operator:"=",
value:"3"
)
),
'type!{
www.appian.com/.../2009}FacetOption'(
id:4,
name:"Manager",
filter:'type!{
www.appian.com/.../2009}QueryFilter'(
field:"titleId",
operator:"=",
value:"4"
)
),
'type!{
www.appian.com/.../2009}FacetOption'(
id:5,
name:"Associate",
filter:'type!{
www.appian.com/.../2009}QueryFilter'(
field:"titleId",
operator:"=",
value:"5"
)
)
}
)
}
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Durgesh
A Score Level 2
over 11 years ago
Few queries -
1) Suppose, 'HR' Department & 'Manager' Title is seletced
Then, what would be the structure of filter query?
filterQuery ==> groupId=4 AND titleId=1
OR
filterQuery ==> 4 AND 1
OR
filterQuery ==> 4,1
And what if only 'HR' department is selected?
2) How this will be applied to an array of appian user objects?
Thanks
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
siddharths
over 10 years ago
Hi Durgeshk, Looking for the same thing. Were you able to figure this one out? TIA
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Durgesh
A Score Level 2
over 10 years ago
Not exactly, some workaround is applied as per business requirement but not fully recommended. Using some functions like IF, SPLIT etc to get the facet values.
Please let me know if you have any best approach for this.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
nechamaz
over 9 years ago
I am working on implementing this as well. Have you had any success?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel