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
17 replies
Subscribers
11 subscribers
Views
9634 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Data and Records
I have a Record Related Action Visibility question. I am querying off of a Data
brianc
over 8 years ago
I have a Record Related Action Visibility question. I am querying off of a Data Store Entity, and pulling in a field called Status (Type: Text). I am trying to use this Status field to evaluate the Visibility for the Related Action. Example: if( rf!status = "Complete", true, false). I have tried multiple variations of this if statement (toboolean(if( rf!status = "Complete", true, false)) - if( rf!status = "Complete", true(), false()) and many others. Nothing seems to be evaluating to true, causing the visibility of the related action not to appear. I have tried evaluating with a Boolean field I am pulling from the Data Store Entity, and it seems to be working fine. Is there anyway to evaluate a text field to allow visibility to work for a related action?
OriginalPostID-154938
OriginalPostID-154938
Discussion posts and replies are publicly visible
0
Tim
Certified Lead Developer
over 8 years ago
You could try the exact() function but it doesn't sound like your expression is the problem given what you've said. For completeness I would try adding the RA to a different record type using a text value evaluation for visibility... just to rule out something iffy with your record.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
brianc
over 8 years ago
Does anyone actually have a working example of the visibility using a text compare? I have tried text compares on multiple instances and I cannot get anything to work. It seems the visibility is only working when comparing against a boolean field from the entity, or setting to =true()
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 8 years ago
@brianc Hi, what you have done is perfectly correct according to my knowledge as well as experience. Especially our team has seen this issue many times and we weren't able to find the exact problem unfortunately. In order to resolve this, we have been taking various approaches such as casting the value to single type (Let's say you have queried a single record from database, you may think that you are retrieving only one record, but when you start using it in the subsequent steps, it behaves like an array and gives unpredictable results when you are in RA rules, but the same works fine everywhere else) when we query database or casting the value to boolean of single type.
One thing I could definitely say according to our team's experience is, the area in which we write related action visibility rules is very much sensitive and behaving in an unusual manner which I can't elaborate as of now (because the rule perfectly works if it is used in an sail interface or script task or expression etc, but the same rule starts behaving differently when it comes to visibility of RA), but yes we are facing some issues and opting for different ways for resolving the issue each time.
If you can attach the code snippet, probably myself or other Appian practitioners who commented above can help you in resolving this.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
brianc
over 8 years ago
Here is the code I am using for the visibility expression...
if(rf!status = "Complete", true, false)
rf!status is a text field in the DB that contains the text "Complete" for our specific instance
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 8 years ago
@brianc Could you please give just one attempt by doing a null check on rf!status prior to making a comparison?
if(
rule!APN_isBlank(rf!status),
false,
if(
rf!status = "Complete",
true,
false
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
normanc
over 8 years ago
If the expression always returns false, then it suggests that the record field rf!status was not found. Perhaps try rf!Status of rf!STATUS to match the case of the CDT.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
brianc
over 8 years ago
The issue has been resolved. The issue was stemming from a misconfigured data source. Even though we were pulling the correct column/variable from the DB, there were hidden values that were messing up our string compare expression. Now the expression if(rf!status = "Complete", true, false) is working exactly how it should. Thank you everyone for your input.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
<