cancel
Showing results for 
Search instead for 
Did you mean: 

Detecting that a question is not present due to Questionnaire hide/show rules

RonSteiner1
Contributor III

Folks,

 

I'm reposting this here since Scott Hagemeyer indicated that a Custom Object may be the only way to accomplish this.

Does anyone have some sample code to detect if a question is not present in a questionnaire because it was not included due to a Questionnaire Hide Rule (not a DDE ACL rule) when generated? 

The reason is that each of our sections contain a bunch of questions that may or may not be present due to Hide Rules along with an additional field that currently is always included. We would like to hide that last field if all of the other fields in the section were excluded from the questionnaire when it was generated. Note that the Hide Rules are complicated enough that we have not been able to come up with one that would hide this extra field too.

 

Thanks,

Ron

2 REPLIES 2

DavidPetty
Archer Employee
Archer Employee

Ron, a [multi-dimensional] array that contains the field ids and loop through the array can calling $CM._Fields[field id) to see if a value comes back or not.  Then based on the results hide the remaining field.

 

The downside is that it introduce technical debt when moving the finding from one environment to another and the IDs would have to be updated after a package install; and there's some ways around this and if any new questions are added the custom object would have to be updated as well.

 Advisory Consultant - Archer, an RSA Business

David,

As I stated in my original post in the regular forum, I'm aware of these issues with custom objects, which is why I tend to avoid them as much as possible. This is especially true given we have 7 environments to coordinate. However, if it's the only way, then I'll have to figure this out.

 

As to your comment "there's some ways around this", can you elaborate? Is there a way to avoid the ID issue?

 

Thanks,

Ron