.NET FilterItems by Category Field, how to return items with value not set?

Comments

4 comments

  • Chuck Cartia

    Is category field a required field? I believe "not set" only works when the category is not required. Otherwise this should work

    dynamic gfilter = new Dictionary<int, object>();
    gfilter.Add(CategoryFieldID, null);
    PodioCollection = Podio.ItemService.FilterItems(AppID, MAXFETCHHLIMIT, offset, gfilter);

    0
    Comment actions Permalink
  • Alexander Toptygin

    Thanks for the quick answer. Confirmed the category field is not required and I had tried filtering by null value with no success it returned with "Sequence Contains no Elements".

    Working around this using FilterItemsByView with a preset view which includes the 'not set' option as well as others.

    Will try the null value filter again.

    0
    Comment actions Permalink
  • Ajmal v Hassainar

    Try this:

    var filter = new Dictionary<string, object>
    {
         {"external-id", new int?[]{ null, 1 } }
     };
    var itemCollection = podio.ItemService.FilterItems(appId, 100, 0, filter);
    

    This will filter items will categoryId 1 and category not set.

    1
    Comment actions Permalink
  • Alexander Toptygin

    Confirmed working now. I must have made a mistake when testing null before. Thank you.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk