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
8 replies
Subscribers
10 subscribers
Views
4111 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Data and Records
dynamically creating default filters on record type?
erickp
over 7 years ago
I am using Appian 16.2. Every user in our application is part of different line of businesses and I would like to add a default filter to a record so that a user can only view the records for whatever line of business he/she is part of. (The record is an entity-backed record which is using a View) The problem is the user can be part of multiple line of businesses so for one row of data, there could be multiple line of businesses. So somehow I need to apply over the line of businesses and dynamically add default filters using the "include" operator. For example, if loggedInUser() is part of three line of businesses, then there has to be three default filters using the includes operator. Note: I can't use the "in" operator in this case. Any ideas on how I can accomplish this?
OriginalPostID-236537
Discussion posts and replies are publicly visible
0
Josh
Certified Lead Developer
over 7 years ago
Why can't you use the "in" operator?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
erickp
over 7 years ago
Let's say one line of business code is 200 and another one is 300. Let's say a logged in user is part of those two line of businesses so I want to return rows that includes 200 and 300. For the rows of data that contains multiple line of businesses (in the format 200::300), I don't think the "in" operator will work. Will it? Which is why I need to do "includes" for 200 and 300 (or however many there are)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Josh
Certified Lead Developer
over 7 years ago
Ah so the data has been flattened in the view. If I couldn't change how the view is built to unflatten the data and if the data is flattened in a predictable way I would build a rule in Appian that would return {"200", "300", "200:300"} if I supplied it {200, 300}. Then my default filter would be businessType in "myNewRule." This would grab every record that has 200, 300, and 200:300.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
erickp
over 7 years ago
Yeah that will complicate things. I wish I had the option to create dynamic filters as if I were writing a dynamic queryFilters() on a query entity rule. That way I can apply over my list of line of businesses and create the filters using the includes operator. Is there any way to accomplish this?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Josh
Certified Lead Developer
over 7 years ago
I don't think you can dynamically create default filters.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 7 years ago
@erickp Have you given thoughts over converting the implementation from Data Store to Service Backed design? The later gives mich flexibility in driving the dataset by applying the filterset as desired.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Jacob Cohen - Project Leader - Macedon Technologies
over 7 years ago
Erick, you can create dynamic default filters if you define an expression as the source of your record. It's significantly more complicated, but it gives you the power to do what you need to do. I'd recommend creating a new Record Type to test, so you don't lose your current work.
forum.appian.com/.../Create_a_Record_Type.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
erickp
over 7 years ago
Yep thanks Jacob. I just ended up doing it that way and it worked. Thanks!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel