Hello everyone, I am new here. I have a survey where I have a list of items a person chooses from; for example:
Select the items below that are included in the report you reviewed:
1. cover page
2. title
3.signature
This is just an example the actual list is different and longer. But if I have a list like that and compliance means all items selected then all is well. But if less than 3 items selected it means out of compliance with the report requirements. So I need the survey to include a statement that says the report is out of compliance because item (whichever was not selected) was not included. How do I do that? I created a statement in the relevant column that says count-selected({$Report!=3}) below is the actual script I used so you would need to scroll all the way to see it. This works great because if the surveyor did not select all items, then it will show the note. However this does not tell me which item was not selected. How do I get it to show which item was not selected?
note | SiteConcerns51 | <b>REAP content:<b> | w4 | "REAPs do not include all requirements in Section VIII. E." | count-selected(${REAPMinimum})!= 7 | 500 |
Is the number of items in this list static? Looks like you already have count-selected(${REAPMinimum})!= 7 which is good (I'd remove that space between = and 7 though. You don't want spaces where they don't need to be). But I'd put it into a separate calculate so you can use it in other places of the survey.
If all you are struggling with is "display the name of the thing that wasn't selected", then you will need to use a series of calculates. This isn't the most straight forward thing for select_multiple. Here is an example where I am actually doing the opposite of you (displaying text when something is selected):
This list has 4 items. The first 4 calculates get the name of the thing via jr:choice-select() and add a comma and a space to the end. The "total" calculate puts them all into a list. The "final" calculate trims off the ', ' at the end.
I work with reviews and compliance a lot. An easier solution IMO would be to have a series of select_one yes_no. Have one for each compliance item, and just ensure they select "yes" where applicable. This typically gives more fine-grain control over the review items, and is a lot easier to work with.
You can use not(). E.g.,
count-selected(${REAPMinimum})>0 and not(selected(${REAPMinimum}, 'The date(s) rain is predicted to occur, and predicted chance of rain'))
Is that actually what appears in your name column? That looks like a label. When writing these, you always reference the name column. E.g., I'd write selected(${ptype},'SFR') and not selected(${ptype},'Single-Tenant Residential')