locked
How to reverse the filter on DataView Web Part? RRS feed

  • Question

  • Hi all,

    Using SPD (SharePoint Designer):

    In my DataView Web Part, I see the option so I can use a filter where
    "FieldName contains Param(ServerVariable)"

    I cannot see any option to filter instead on
    "Param(ServerVariable) contains FieldName"

    Any help on how to achieve this will be appreciated.

    Thanks,


    • Edited by Mike Walsh FIN Tuesday, May 24, 2011 6:49 AM DVWP: prefix not needed in Title. DVWP stated in full in Title
    • Moved by Mike Walsh FIN Tuesday, May 24, 2011 6:49 AM DVWP = SPD 2007 = customization forum (From:SharePoint - General Question and Answers and Discussion (pre-SharePoint 2010))
    Monday, May 23, 2011 9:08 PM

Answers

  • Since CAMLs syntax is Field Contains Value, I don't believe there is any way to just do a filter for Value Contains Field.

    I'm assuming (which we all know what that does) that your Parameter is a maybe multiple values like "1,2,3,4" and you want to find those field values 1, 2, 3, or 4?  

    If you can break the parameter up somehow (multiple Query String variables?) you can still use the filter option... otherwise you'll probably need to modify the CAML query directly in the source view manually. Not fun... Your goal here SOUNDS like to create a query that is "if field = 1 or field = 2 or field = 3 or field = 4".

    It might help us to understand the bigger picture here for what you are trying to accomplish, this can sometimes bring "light bulb" moments in the forums.

    Good luck,

    Mark

     

     


    The SharePoint Hillbilly
    Fewer Big Words... More Pretty Pictures... http://www.SharePointHillbilly.com
    • Marked as answer by Leoyi Sun Friday, June 3, 2011 9:30 AM
    Tuesday, May 24, 2011 12:20 PM