Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am trying to hard code a user group into a CAML query's where clause. The reason is so that I can apply additional criteria when the user is in one group, and something else if they are in another group. I don't want to check the "Assigned To" field for a value, I just want to hard code a user group in it. How do I do that? Thank you. Here is the CAML :

<Query>
                <Where>
                    <Membership Type="CurrentUserGroups">
                      <FieldRef Name="AssignedTo"/>
                    </Membership>
                </Where>
                <GroupBy Collapse="FALSE">
                    <FieldRef Name="AssignedTo"/>
                </GroupBy>
                <OrderBy>
                    <FieldRef Name="AssignedTo"/>
                    <FieldRef Name="Status"/>
                    <FieldRef Name="Priority"/>
                </OrderBy>
            </Query>
share|improve this question

2 Answers 2

up vote 1 down vote accepted

Another solution is to add another people or group field in the list and populate it with a workflow. Then, use that field in between the membership type elements instead of "AssignedTo".

share|improve this answer

This is a long shot but try just entering the name of the group in between the Membership tags. You may need to format it with the group ID, then ;# and finally the group name.

share|improve this answer
    
Thank you Alex. I tried 14;#Division_x0020_Managers in between the membership tags but wasn't successful. –  Anonymous Jul 5 '10 at 17:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.