# Retrieve or search channel when user not a member of this channel

**URL:** <https://community.sendbird.com/t/retrieve-or-search-channel-when-user-not-a-member-of-this-channel/7527>\
**Category:** JavaScript\
**Tags:** group-channel, react-js, chatsdk\
**Created:** [June 8, 2023, 10:24am UTC](https://community.sendbird.com/t/retrieve-or-search-channel-when-user-not-a-member-of-this-channel/7527 "2023-06-08T10:24:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NikShein](https://avatars.discourse-cdn.com/v4/letter/n/ecb155/32.png) [@NikShein](https://community.sendbird.com/u/NikShein)\
**Post date:** [June 8, 2023, 10:24am UTC](https://community.sendbird.com/t/retrieve-or-search-channel-when-user-not-a-member-of-this-channel/7527/1 "2023-06-08T10:24:55Z")

</div>

**[Problem/Question]**  
Hey there! How I can get a channel when I am not a member of this channel?  
I try to use

```auto
const channel = await sb.groupChannel.getChannel(CHANNEL_URL);

```

and searching queries but if I understood correctly they return channels where I am a member.  
My logic is I click on a button and I should be automatically entered (invited) to a specific channel, but before it, I need to check whether this channel is created or not. Could you help me, please?

---

<div class="post-metadata">

**Author:** ![uday.bhaskar](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/uday.bhaskar/32/3966_2.png) [@uday.bhaskar](https://community.sendbird.com/u/uday.bhaskar)\
**Post date:** [June 16, 2023, 11:01am UTC](https://community.sendbird.com/t/retrieve-or-search-channel-when-user-not-a-member-of-this-channel/7527/3 "2023-06-16T11:01:28Z")

</div>

Hello @NikShein,

A [`PublicGroupChannelListQuery`](https://docs.sendbird.com/docs/chat/v4/javascript/ref/classes/_sendbird_chat_groupChannel.PublicGroupChannelListQuery.html) instance provides several types of search filters such as `ChannelNameContainsFilter` and `ChannelUrlsFilter` . You can use these filters to search for specific public group channels.

To retrive both channels where the current user is and isn’t a member, set [membershipFilter](https://docs.sendbird.com/docs/chat/v4/javascript/ref/classes/_sendbird_chat_groupChannel.PublicGroupChannelListQuery.html#membershipFilter) to `ALL`

**Sample Code:**

```auto
const params = {
  includeEmpty: true,
  channelNameContainsFilter: 'Sendbird',
  membershipFilter: MembershipFilter.ALL
};
const query = sb.groupChannel.createPublicGroupChannelListQuery(params);
const channels = await query.next();

```
