Unable to use the when-rule: [Pagelist] contains a page where [Property] equals [Value]
I have a page list like .employees: name, gender, age, etc
I want to check is there any female employee,
so I would create a when rule which checks:
[.Employees] contains a page where [.gender] equals ['false']
After that, the error appears:
1. Pega don't allow me to choose [.gender], it only pop up property at current class, which .Employees should represent a list of a sub-class.
2. When I try to save it like [.Employees.gender] or [.Employees(<CURRENT>).gender] or [.Employees().gender], none of them work.
Field name in condition definition—
Property @baseclass.Employees is undefined.
Invalid expression or reference: No candidates found [possible function name, ruleset/version or number of parameter problem]
Invalid expression or reference: Operation "==" is not permitted on types: truefalse and unknown
If it is mean to fail, why not just remove it from the when rule, and explicitly suggest us to use Activity or data transform instead.(BTW, how to use activity or data transform to achieve this goal)
If I can write my own pure function it would be super easy. Just that pega don't allow us code by ourselves, so we have to look for a "reinvented wheel"(aka. OOTB function).
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
Finally we manage to do it via expression in when rule. @IsInPageList("true", ".Gender", .Employees)
Or if you want to make use of this When Rule Option, don't rely on their AutoComplete controls. Use text for both [PageList name] filed and [Value] field, just like how they are taken by the "IsInPageList" method. (Note that there is a dot in the page list name, and the value should also be quoted)
[.Employees] contains a page where [".Gender"] equals ["true"]
But please do fix the scope of the autocomplete control someday. I am too lazy to formally file a Support Request for that.
Keep up to date on this post and subscribe to comments
- Unable to use the rule: Pagelist contains a page where Property equals Value
- Removing duplicate page in pagelist based on 2 property values in that pagelist page.
- How to Set property values as comma separated values when pagelist contains duplicates
- IsInPageListWhen is not able to identify WHEN rule name when the function is being used for each embedded page of another pagelist
- I have a flow and i need to start it in activity based on the pages of a pagelist property. For each page I have to start the flow as a new wo and I need to pass one property value from the page of pagelist property.