Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Suggested Answer
+1
person also asked this
people also asked this
Replies
12 replies
Answers
1 answer
Subscribers
13 subscribers
Views
5475 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Data and Records
Hey everyone, Im trying to implement a default filter for my entity b
benjamins
over 8 years ago
Hey everyone,
Im trying to implement a default filter for my entity backed record and return back results where a particular field is either false or null (not true). I have tried using <> true, and or(null, false) and both are failing to return back the results I need.
Anyone have any ideas on this one?
OriginalPostID-198637
OriginalPostID-198637
Discussion posts and replies are publicly visible
Top Replies
michszym
over 1 year ago
+2
suggested
Certified Associate Developer
Use a custom field and add a default value to it a!customFieldDefaultValue( value: 'recordType.booleanFieldWithNulls', default: false ) Name it something like fieldName + "NullSafe", and then filter…
Parents
0
sikhivahans
over 8 years ago
@benjamins As per my knowledge, here goes few approaches to solve the issue:
1. Shifting the implementation from Entity Backed to Expression Backed. You can query the entity with the filters as desired by you as the source of the data is expression backed.
Drawback of this approach is that the configuration is slightly time-consuming but is much advantageous in terms of flexibility.
2. Set NULL as false in the corresponding database entity.
If you are making use of a view, make sure that column(that hold boolean values) is able to render false in case if the column holds NULL value. (IFNULL(my_boolean_column,false) according to MySQL.)
In case of a table being used, then update the column(that hold boolean values) in the table so that NULL is replaced by false (UPDATE my_table SET my_boolean_column = false where my_boolean_column IS NULL) and also make sure that this change is handled in the process (new + inflight instances). (Off-course, you can make your Record Type refer a data store entity based on a view instead of table, and make the view hold the same data as the table.)
Prior to resorting for the approaches mentioned above, I would suggest you try configuring the default filters in all possible ways and also let's see if any other practitioners can suggest a simple work around for this.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
sikhivahans
over 8 years ago
@benjamins As per my knowledge, here goes few approaches to solve the issue:
1. Shifting the implementation from Entity Backed to Expression Backed. You can query the entity with the filters as desired by you as the source of the data is expression backed.
Drawback of this approach is that the configuration is slightly time-consuming but is much advantageous in terms of flexibility.
2. Set NULL as false in the corresponding database entity.
If you are making use of a view, make sure that column(that hold boolean values) is able to render false in case if the column holds NULL value. (IFNULL(my_boolean_column,false) according to MySQL.)
In case of a table being used, then update the column(that hold boolean values) in the table so that NULL is replaced by false (UPDATE my_table SET my_boolean_column = false where my_boolean_column IS NULL) and also make sure that this change is handled in the process (new + inflight instances). (Off-course, you can make your Record Type refer a data store entity based on a view instead of table, and make the view hold the same data as the table.)
Prior to resorting for the approaches mentioned above, I would suggest you try configuring the default filters in all possible ways and also let's see if any other practitioners can suggest a simple work around for this.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data