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
5 replies
Subscribers
7 subscribers
Views
2005 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Hi all, I am just wondering what would be the best way to design a qu
moritzw
over 12 years ago
Hi all,
I am just wondering what would be the best way to design a query of a datastore with dynamic search parameters? If I use query rules I have to create X! query rules for X possible search parameters. Is there a way to inject dynamic sql into a query database node? Also it would be a very handy enhancement for query rules to support dynamic queries.
Thanks, Moritz...
OriginalPostID-69755
OriginalPostID-69755
Discussion posts and replies are publicly visible
0
Alex Weller
Appian Employee
over 12 years ago
Moritz, if you are using strings, you can design your query rule to use the "includes" operator. These inputs can then either be used or unused and should still return valid results. Number and date inputs can be designed as ranges (start input and end input) with all encompassing defaults. If modified they will narrow down results, if unused they would not affect the results.
Hope it helps!
Alex
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
moritzw
over 12 years ago
Hi Alex,
thanks for the hint. I build a query rule with four text parameters, which are all using the includes operator in the query. If I pass in no values at all I am getting back an empty result set. I would have benn expecting the list of all entries or am I misunderstanding how this should be used?
Thanks, Moritz
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
moritzw
over 12 years ago
Never mind. Seems to be working now. I changed some values in my CDT and updated the data store, so I guess there were some inconsistencies for a while.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
moritzw
over 12 years ago
There seems to be one issue with this approach though. If there is a row that has a null value in one of the queried columns its not being returned.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
subhankarb
over 12 years ago
Yes Moritzw...thats how the includes operator works. It ignores all the null value. Best way of doing it would be writing a stored procedure in DB and calling it in Appian.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel