# How to \`includeEmpty\` for React Native GroupChannelListFragment

**URL:** <https://community.sendbird.com/t/how-to-includeempty-for-react-native-groupchannellistfragment/8384>\
**Category:** Sendbird Chat UIKit\
**Created:** [October 7, 2023, 4:53am UTC](https://community.sendbird.com/t/how-to-includeempty-for-react-native-groupchannellistfragment/8384 "2023-10-07T04:53:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kris](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/kris/32/4588_2.png) [@Kris](https://community.sendbird.com/u/Kris)\
**Post date:** [October 7, 2023, 4:53am UTC](https://community.sendbird.com/t/how-to-includeempty-for-react-native-groupchannellistfragment/8384/1 "2023-10-07T04:53:25Z")

</div>

**[Problem/Question]**  
I’m trying to customize the query for the `GroupChannelListFragment` so that it will includeEmpty chats. No matter what I try it seems to run into an error. The docs didn’t seem to have anything on it and I also tried asking the docs bot but their suggestions also gave errors.

Things I’ve tried:

```auto
const GroupChannelListScreen = () => {
  const navigation = useNavigation();
  const defaultQuery = GroupChannel.createMyGroupChannelListQuery({includeEmpty: true});

  return (
    <GroupChannelListFragment
      collectionCreator={{queryCreator: defaultQuery}}
      ...
    />
  );
};

```

```auto
  const {sdk} = useSendbirdChat();
  const defaultQuery = sdk.GroupChannel.createMyGroupChannelListQuery({includeEmpty: true});

```

---

<div class="post-metadata">

**Author:** ![Kris](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/kris/32/4588_2.png) [@Kris](https://community.sendbird.com/u/Kris)\
**Post date:** [October 8, 2023, 12:48pm UTC](https://community.sendbird.com/t/how-to-includeempty-for-react-native-groupchannellistfragment/8384/2 "2023-10-08T12:48:09Z")

</div>

Another thing I tried:

```auto
const GroupChannelListScreen = () => {
  const {sdk} = useSendbirdChat();
  function collectionCreator() {
    return sdk.groupChannel.createMyGroupChannelListQuery({
      includeEmpty: true,
    });
  }

  return (
    <GroupChannelListFragment
      collectionCreator={{queryCreator: collectionCreator}}
      ...
    />
  );
};

```

Error:

```auto
Possible Unhandled Promise Rejection (id: 31):
TypeError: Object is not a function

```

Also tried this:

```auto
const GroupChannelListFragment = createGroupChannelListFragment({
  Fragment: {
    collectionCreator: () => ({
      queryCreator: {
        includeEmpty: true,
      },
    }),
  },
});

```

which has no errors but doesn’t seem to show any empty channels

---

<div class="post-metadata">

**Author:** ![rahul](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@rahul](https://community.sendbird.com/u/rahul)\
**Post date:** [October 9, 2023, 7:53am UTC](https://community.sendbird.com/t/how-to-includeempty-for-react-native-groupchannellistfragment/8384/3 "2023-10-09T07:53:05Z")

</div>

Hello @Kris ,

You can set `includeEmpty` to query using `queryCreator` or `collectionCreator` props in the `GroupChannelListFragment`.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/c/cd26e48a7e6ebc7e71717ee41cbb3eb5b0ed7fc2.png)

---

<div class="post-metadata">

**Author:** ![Kris](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/kris/32/4588_2.png) [@Kris](https://community.sendbird.com/u/Kris)\
**Post date:** [October 9, 2023, 1:03pm UTC](https://community.sendbird.com/t/how-to-includeempty-for-react-native-groupchannellistfragment/8384/4 "2023-10-09T13:03:38Z")

</div>

@rahul Didn’t work for me:

 ![Screenshot 2023-10-09 at 8.00.14 AM](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/5/5ecfe4ba919f53fd48069f5383e863ce0ae477d9.png)

Also tried:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/2/2072146ecf8d691b5383d3f4551e18ea6cf63b84.png)

And tried:

```auto
const GroupChannelListScreen = () => {
  const {sdk} = useSendbirdChat();
  const navigation = useNavigation();
  const filter = sdk.groupChannel.createMyGroupChannelListQuery({
    includeEmpty: true,
  });
  const test = () => {
    return sdk.groupChannel.createGroupChannelCollection({
      filter,
      limit: 20,
      order: 'latest_last_message',
    });
  };

  return (
    <GroupChannelListFragment
      collectionCreator={test}
      onPressCreateChannel={channelType => {
        navigation.navigate('GroupChannelCreate', {channelType});
      }}
      onPressChannel={channel => {
        navigation.navigate('GroupChannel', {channelUrl: channel.url});
      }}
    />
  );
};

```

Dashboard has like 5 group channels, none of which are showing. Added a `console.log(query)` and it didn’t even seem like that was even being hit. queryCreator doesn’t seem to be a valid prop when i click to find the reference

---

<div class="post-metadata">

**Author:** ![Kris](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/kris/32/4588_2.png) [@Kris](https://community.sendbird.com/u/Kris)\
**Post date:** [October 10, 2023, 6:31pm UTC](https://community.sendbird.com/t/how-to-includeempty-for-react-native-groupchannellistfragment/8384/5 "2023-10-10T18:31:04Z")

</div>

Finally figured it out HAHAH

```auto
collectionCreator={() => {
  const groupChannelFilter = new GroupChannelFilter();
  groupChannelFilter.includeEmpty = true;

  const params = {
    filter: groupChannelFilter,
    order: 'latest_last_message',
  };
  return sdk.groupChannel.createGroupChannelCollection(params);
}}

```
