I have a Record Related Action Visibility question. I am querying off of a Data

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
    Certified Lead Developer
    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.
  • 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()
  • @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.
  • 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
  • @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
              )
    )
  • 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.
  • 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.