Hi,
I'm struggling with a Filler form where I seem to fail at defining the appropriate structure/rules to support the requirements.
My participants are as follows and they must all be unique:
a) Requester
b) 5 mandatory reviewers
c) 2 reviewers that are required only if a "Risk assessment " dropdown is less than certain value: field < "03". That drop down has values of 01, 02, 03, 04 and 05.
d) 1 reviewer that is required only if the dropdown above is less than "02".
e) 1 more reviewer dependent on the "Delivery Type" dropdown.
I've defined User Roles for each of those participants mapping to the AccountId in the structure below.
For the sake of consistency, I decided to use People picker(s) to allow the Requester to identify the reviewers but for c) d) and e), both dropdowns above can be modified after the fact by the first 2 mandatory reviewers, which would obviously change who's review is actually required.
Also, since date pickers cannot be hidden, I decided to use a single Date picker to grab the review date and copy it to the current logged on reviewer's date. I've toyed with the structure below and with the idea of a repetitive group but because specific reviewers are required only some of the time, unless I'm mistaken, the repetitive group does not seem to fit these requirements.
Using the structure below, I'm able to hide/show the necessary reviewers using the "reviewRequired" field that gets updated as we go along. However, I can't seem to hide/show my capturing date picker* based on their role AND THEIR empty review date (since I can only have 5 conditions on the field). i.e. I only want to show the date picker if the reviewer had not already reviewed. I'm trying to match the userRole() to the reviewRole and see if the "preceding" node for the reviewDate is empty. I can't seem to make that work.
I'm struggling to write the appropriate rule(s). With 9 reviewers that would be 18 rules plus a couple more for other reasons on that section:
1. if role is xyz AND reviewDate IS NOT blank: hide
2. if role is xyz AND reviewDate IS blank AND reviewRequired = 0 : hide
Also, how can I write a condition that will compare the number of empty dates for the required reviews? This formula does not seem to return the correct values:
concat("-AccountIds: ", count(my:reviewers[//pc:AccountId != ""]), " -Required: ", count(my:reviewers[//my:reviewRequired = "1"]), " -Reviewed: ", count(my:reviewers[//my:reviewDate != ""]))
* Capturing date picker is a separate field that I'm using to transfer the date to the appropriate structure below through code behind. It is placed in a section to allow for hiding it.
* Requester is handled separately because I grab their UserName() and they can't submit the form unless they provide me with their review date (using same Capturing date picker).
Here's my non-repetitive structure. Again, it may not be the best design so I'm open to criticism and suggestions ;-)
<my:reviewers>
<my:engagementManager>
<my:ppicker>
<pc:Person>
<pc:DisplayName></pc:DisplayName>
<pc:AccountId></pc:AccountId>
<pc:AccountType></pc:AccountType>
</pc:Person>
</my:ppicker>
<my:review>
<my:reviewDate xsi:nil="true"></my:reviewDate>
<my:reviewRole>Engagement Manager</my:reviewRole>
<my:reviewRequired>1</my:reviewRequired>
</my:review>
</my:engagementManager>
<my:engagementLeader>
<my:ppicker>
<pc:Person>
<pc:DisplayName></pc:DisplayName>
<pc:AccountId></pc:AccountId>
<pc:AccountType></pc:AccountType>
</pc:Person>
</my:ppicker>
<my:review>
<my:reviewDate xsi:nil="true"></my:reviewDate>
<my:reviewRole>Engagement Leader</my:reviewRole>
<my:reviewRequired>1</my:reviewRequired>
</my:review>
</my:engagementLeader>
<my:functionalRRL>
<my:ppicker>
<pc:Person>
<pc:DisplayName></pc:DisplayName>
<pc:AccountId></pc:AccountId>
<pc:AccountType></pc:AccountType>
</pc:Person>
</my:ppicker>
<my:review>
<my:reviewDate xsi:nil="true"></my:reviewDate>
<my:reviewRole>Function RRL</my:reviewRole>
<my:reviewRequired>0</my:reviewRequired>
</my:review>
</my:functionalRRL>
<my:officeRRL>
<my:ppicker><pc:Person>
<pc:DisplayName></pc:DisplayName>
<pc:AccountId></pc:AccountId>
<pc:AccountType></pc:AccountType>
</pc:Person>
</my:ppicker>
<my:review>
<my:reviewDate xsi:nil="true"></my:reviewDate>
<my:reviewRole>Office RRL</my:reviewRole>
<my:reviewRequired>0</my:reviewRequired>
</my:review>
</my:officeRRL>
<my:cbcRRL>
<my:ppicker>
<pc:Person>
<pc:DisplayName></pc:DisplayName>
<pc:AccountId></pc:AccountId>
<pc:AccountType></pc:AccountType>
</pc:Person>
</my:ppicker>
<my:review>
<my:reviewDate xsi:nil="true"></my:reviewDate>
<my:reviewRole>Firm RRL</my:reviewRole>
<my:reviewRequired>0</my:reviewRequired>
</my:review>
</my:cbcRRL>
<my:leadEngagementPartner>
<my:ppicker>
<pc:Person>
<pc:DisplayName></pc:DisplayName>
<pc:AccountId></pc:AccountId>
<pc:AccountType></pc:AccountType>
</pc:Person>
</my:ppicker>
<my:review>
<my:reviewDate xsi:nil="true"></my:reviewDate>
<my:reviewRole>Lead Engagement Partner</my:reviewRole>
<my:reviewRequired>1</my:reviewRequired>
</my:review>
</my:leadEngagementPartner>
<my:qaReviewer>
<my:ppicker>
<pc:Person>
<pc:DisplayName></pc:DisplayName>
<pc:AccountId></pc:AccountId>
<pc:AccountType></pc:AccountType>
</pc:Person>
</my:ppicker>
<my:review>
<my:reviewDate xsi:nil="true"></my:reviewDate>
<my:reviewRole>QA Reviewer</my:reviewRole>
<my:reviewRequired>0</my:reviewRequired>
</my:review>
</my:qaReviewer>
<my:secPPD>
<my:ppicker>
<pc:Person>
<pc:DisplayName></pc:DisplayName>
<pc:AccountId></pc:AccountId>
<pc:AccountType></pc:AccountType>
</pc:Person>
</my:ppicker>
<my:review>
<my:reviewDate xsi:nil="true"></my:reviewDate>
<my:reviewRole>SEC PPD</my:reviewRole>
<my:reviewRequired>0</my:reviewRequired>
</my:review>
</my:secPPD>
<my:auditEngagementPartner>
<my:ppicker>
<pc:Person>
<pc:DisplayName></pc:DisplayName>
<pc:AccountId></pc:AccountId>
<pc:AccountType></pc:AccountType>
</pc:Person>
</my:ppicker>
<my:review>
<my:reviewDate xsi:nil="true"></my:reviewDate>
<my:reviewRole>Dept Engagement Partner</my:reviewRole>
<my:reviewRequired>0</my:reviewRequired>
</my:review>
</my:auditEngagementPartner>
</my:reviewers>