Complex View Selection

I have a complex (for me, anyway) view selection I can’t make work.

I want all status=active forms and all children for those forms, but only if the children do not have the “confidential” field checked.

It seems this would be a common situation, but no combination of view selection criteria i’ve tried seems to work.

thanks in advance

Subject: Complex View Selection

SELECT (Form=“Active”) | (Form=“ResponseForm” & Confidential!=“Checked”)

Might could work for you.

Subject: RE: Complex View Selection

This worked perfectly.

I agree with the other message…@AllChildren has to come at the end and I couldn’t find a way to “qualify” it.

but this worked.

Thanks.

Subject: RE: Complex View Selection

Ah. I misunderstood your requirement. You said:

I want all status=active forms and all children for those forms, but only if the children do not have the “confidential” field checked.

What you actually meant was,

I want all main documents where status=active, and also all of their responses that do not have the “confidential” field checked.

However, File Save’s formula will not give you that. It also includes responses to main documents whose status is not “Active”. You don’t see them in the view normally because their parent document isn’t there for them to appear under, but if you do a full-text search you can find them.

Subject: Complex View Selection

select (Status = “Active” | @allchildren) & (Confidential = “Y”)

should do. If the Confidential field is also called Status, however, you may have to actually change your form design to make this work.

Subject: RE: Complex View Selection

The documentation for @AllChildren states that it must come at the end of the expression, after an “|”. In any case, this formula will not meet the requirement.

There is no way to select documents based on the contents of other documents – only based on their own contents. So you can’t use a selection formula to limit a view to just documents that have or don’t have a particular type of response.

There are a couple of ways to approach this. You can write an agent to test documents based on your criteria and assign a field in the main document to say whether it should appear in the view. This would have to handle later changes to the documents, e.g. if a response was edited and its status changed from confidential to not, you’d have to check the other responses to the main document and see whether it now qualifies to appear in the view.

The other way is to not use a view, but a folder. You would still need an agent to check whether documents qualify, but rather than modifying the documents it would put them into or remove them from the folder.

The advantage to the latter approach is that you’re not modifying documents, which is both better for performance, and avoids save conflicts with users who might be editing those documents at the time. The disadvantage is that you have to take measures in your design of each of your other folders and views to prevent people changing the folder membership manually (if you care about that).