locked
CQWP pulling unassigned from "assigned to" field RRS feed

  • Question

  • I've been working with the CQWP rolling up tasks lists for various members in my team. I was trying to make a master list of unassigned tasks but am  having trouble getting this to work. Is there a way to pull from the people picker field, tasks that are not assigned to anyone aka blank assigned to field? It looks like saying "not equal to" and listing out every ID doesn't want to work either since I can only enter 1 item.

     

    Monday, November 14, 2011 6:41 PM

Answers

  • Hi,

    As an alternative create a field like istaskAssigned. Provide a value to set it as 1 or 0 based on the task is assigned to someone or not.

    To update this value automatically you can use SPD workflow.

    Now filter this to show tasks.

    I hope this will help you out.


    Thanks, Rahul Rashu
    • Marked as answer by flashfx21 Tuesday, December 13, 2011 12:44 PM
    Wednesday, November 30, 2011 5:59 PM
  • Hi Flash, You would create a simple text column and then use a SP Designer workflow to update that column based on the value of your Assigned To field. A regular calculated column does not allow you to reference the Assigned To field, which is why you need the workflow to update your text column. Create a workflow that runs when an item is created and also when modified that sets the value of your new text column to something like '0' if Assigned To equals '' and '1' if Assigned To not equals ''. Once you have that column set up you can reference it in your CQWP settings as a filter option. Hope that helps, Chanda
    • Marked as answer by flashfx21 Tuesday, December 13, 2011 12:44 PM
    Wednesday, December 7, 2011 3:54 PM

All replies

  • Hi Flash,

    Have you tried setting the CQWP filter to "greater than" instead of "equal to" and then leaving the value field blank?  From what I can tell if you do a comparison of equals and leave the value blank the filter is ignored, but it seems to work as greater than.

    Chanda

    • Marked as answer by flashfx21 Monday, November 14, 2011 7:57 PM
    • Unmarked as answer by flashfx21 Tuesday, November 29, 2011 12:46 PM
    Monday, November 14, 2011 7:14 PM
  • Hi Chanda

    After some testing it seems your solution is not getting me the results I need.

    • Leaving the filter blank yields Tasks assigned and Tasks unassigned
    • "Assigned To" > (blank) filter yields Tasks assigned (ignores Tasks unassigned)

    What I'm trying to get is the Tasks that are unassigned and ignore the Tasks that are assigned. Any ideas on how I can obtain this result? Thanks.

    Friday, November 18, 2011 2:51 PM
  • Hi Flash,

    Sounds like I was thinking opposite of what you'd said in your first post.  Have you tried changing to "Assinged To" < "a" (or any character)?  Seems like that would be the opposite and pull up anything that doesn't have a value.

    Chanda

    Friday, November 18, 2011 3:57 PM
  • I tried entering less than A and "A" (with quotes) but get the following:

    Please specify one of the following [PageFieldValue: (field name)] or [PageQueryString: (query string parameter name)] or an integer value for setting up a dynamic date range for date fields.

    After looking up the two suggestions I found:

    PageFieldValue – allows you to use the current value of a field on the current page.
    PageQueryString – allows you to grab the value of a query string in the URL.

    Neither seems to work correctly; any other ideas?

     

    Wednesday, November 23, 2011 8:43 PM
  • Hi Flash,

    I, too, can't get the CQWP to work for a null value in the Assigned To field.  I've looked around for way to use the QueryOverride property (available if you export the webpart and modify it), but can't see a way to do it that way either.

    As an alternative, have you tried using SharePoint Designer to insert a dataview webpart on your page to display the same information?  If you insert a DVWP based on your task list with the columns you want displayed, you can use XSLT filtering to set the condition to  

    [@AssignedTo = '']

    I tried using the standard filter options for the DVWP but it seems to act much like the CQWP (just ignores if you are testing for null Assignee), but if you go one step further and use the above value for an XSLT filter it seems to return the correct items.

    Hope that helps!
    Chanda

    Wednesday, November 30, 2011 3:14 PM
  • Hi,

    As an alternative create a field like istaskAssigned. Provide a value to set it as 1 or 0 based on the task is assigned to someone or not.

    To update this value automatically you can use SPD workflow.

    Now filter this to show tasks.

    I hope this will help you out.


    Thanks, Rahul Rashu
    • Marked as answer by flashfx21 Tuesday, December 13, 2011 12:44 PM
    Wednesday, November 30, 2011 5:59 PM
  • Could you explain what type/how to create a field to be based on the assigned to field? Not sure if it should be a calculated field or value or something else.
    • Edited by flashfx21 Monday, December 5, 2011 4:01 PM
    Monday, December 5, 2011 3:57 PM
  • Hi Flash, You would create a simple text column and then use a SP Designer workflow to update that column based on the value of your Assigned To field. A regular calculated column does not allow you to reference the Assigned To field, which is why you need the workflow to update your text column. Create a workflow that runs when an item is created and also when modified that sets the value of your new text column to something like '0' if Assigned To equals '' and '1' if Assigned To not equals ''. Once you have that column set up you can reference it in your CQWP settings as a filter option. Hope that helps, Chanda
    • Marked as answer by flashfx21 Tuesday, December 13, 2011 12:44 PM
    Wednesday, December 7, 2011 3:54 PM
  • Hi Chanda,

    I was able to get the workflow created and tested to ensure it works fine. Thanks! My only issue is running the workflow on all the lists. When I tried to run it on the lists it made me do it by item. I imagine there is a way to run it on the entire list once rather than one item at a time? Sorry for all the questions, I keep running into hurdles.

    Monday, December 12, 2011 10:51 PM