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
2 replies
Subscribers
7 subscribers
Views
1115 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Hi all, I'm having a bit of a problem with an expression I wrote.
caz
A Score Level 1
over 10 years ago
Hi all,
I'm having a bit of a problem with an expression I wrote. The code is as follows:
if(rule!Utils_CheckIsNULLText(ri!PreferredProvider),ri!P_Values,if(
rule!getProviderByName(ri!PreferredProvider).IsActive=false(),insert(ri!P_Values,ri!PreferredProvider,1),ri!P_Values))
P_Values is a text array and PreferredProvider is text.
If PreferredProvider is null, the expression works as expected. If it is not null, instead of returning an array it returns the first item in the array.
Any ideas? It's got me stumped!
Thanks!...
OriginalPostID-99891
OriginalPostID-99891
Discussion posts and replies are publicly visible
0
hemalathat
A Score Level 1
over 10 years ago
You can check couple of things in your expression.
1) Check whether the pv that is used to store the result is multiple.
2) I assume that the rule!getProviderByName is Query rule. In that case, there may be a chance of getting null as well as multiple result. So it is better to add null check for that rule. If the result is not empty, please pick any specific index value from the result and then compare that with the Boolean.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
caz
A Score Level 1
over 10 years ago
Hi, getting the first index of the query rule's output has totally solved my problem, thanks so much!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel