# Default channel name set to "Group Channel" when there are 2 users only. How to change that to show the person's name as personal chat?

**URL:** <https://community.sendbird.com/t/default-channel-name-set-to-group-channel-when-there-are-2-users-only-how-to-change-that-to-show-the-persons-name-as-personal-chat/858>\
**Category:** JavaScript\
**Tags:** open-channel, group-channel, react-js, chatsdk\
**Created:** [August 27, 2020, 10:55pm UTC](https://community.sendbird.com/t/default-channel-name-set-to-group-channel-when-there-are-2-users-only-how-to-change-that-to-show-the-persons-name-as-personal-chat/858 "2020-08-27T22:55:36Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jay\_Patel](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/jay_patel/32/449_2.png) [@Jay\_Patel](https://community.sendbird.com/u/Jay_Patel)\
**Post date:** [August 27, 2020, 10:55pm UTC](https://community.sendbird.com/t/default-channel-name-set-to-group-channel-when-there-are-2-users-only-how-to-change-that-to-show-the-persons-name-as-personal-chat/858/1 "2020-08-27T22:55:36Z")

</div>

Hey SendBird team,

We are facing this issue. When we start a new chat with a user in React UIKit it shows channel name as “Group Channel”. While in iOS UIKit it shows channel name as a person’s name with whom we are chatting. So how can we make changes in React UIKit to behave the same as iOS?  
iOS image [iOS\_Chat](https://ibb.co/5vhv9SM)  
React image [React\_Chat](https://ibb.co/N30KszP)

---

<div class="post-metadata">

**Author:** ![Woo](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/woo/32/125_2.png) [@Woo](https://community.sendbird.com/u/Woo)\
**Post date:** [August 27, 2020, 11:16pm UTC](https://community.sendbird.com/t/default-channel-name-set-to-group-channel-when-there-are-2-users-only-how-to-change-that-to-show-the-persons-name-as-personal-chat/858/2 "2020-08-27T23:16:53Z")

</div>

hi @Jay_Patel you can create a channel with name. Please refer [https://docs.sendbird.com/javascript/group\_channel#3\_create\_a\_channel](https://docs.sendbird.com/javascript/group_channel#3_create_a_channel) where you can use `NAME` parameter as the name of channel name.

---

<div class="post-metadata">

**Author:** ![Jay\_Patel](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/jay_patel/32/449_2.png) [@Jay\_Patel](https://community.sendbird.com/u/Jay_Patel)\
**Post date:** [August 27, 2020, 11:38pm UTC](https://community.sendbird.com/t/default-channel-name-set-to-group-channel-when-there-are-2-users-only-how-to-change-that-to-show-the-persons-name-as-personal-chat/858/3 "2020-08-27T23:38:48Z")

</div>

Hey @Woo, I looked into that. But what I want to know is how I can set users name?  
I can set name but that would be default for all channels which we create using that name.  
What I exactly want to do is, if more than 1 user selected than we can use “Group Channel”, if only 1 user is selected than we can use selected users name to use as channel name.

---

<div class="post-metadata">

**Author:** ![Woo](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/woo/32/125_2.png) [@Woo](https://community.sendbird.com/u/Woo)\
**Post date:** [August 27, 2020, 11:59pm UTC](https://community.sendbird.com/t/default-channel-name-set-to-group-channel-when-there-are-2-users-only-how-to-change-that-to-show-the-persons-name-as-personal-chat/858/4 "2020-08-27T23:59:12Z")

</div>

I’m not quite sure what you mean by “default for all channels”. You can create name parameter dynamically when you want to create a channel. In other word, you can provide custom channel name each time you create a channel.

---

<div class="post-metadata">

**Author:** ![Jay\_Patel](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/jay_patel/32/449_2.png) [@Jay\_Patel](https://community.sendbird.com/u/Jay_Patel)\
**Post date:** [August 28, 2020, 12:21am UTC](https://community.sendbird.com/t/default-channel-name-set-to-group-channel-when-there-are-2-users-only-how-to-change-that-to-show-the-persons-name-as-personal-chat/858/5 "2020-08-28T00:21:05Z")

</div>

Suppose if I set name = “NAME” and that will set whenever I create new channel.  
What I want to do is if there is only 1 user selected, I want to get the name of that user and use that as channel name.  
Eg: I create channel with you and me. So if I see chat from my side it should show your name and if you see chat from your side it should show my name.

Are we able to do that in React UIKit?

---

<div class="post-metadata">

**Author:** ![Sravan\_S](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/sravan_s/32/83_2.png) [@Sravan\_S](https://community.sendbird.com/u/Sravan_S)\
**Post date:** [August 28, 2020, 12:57am UTC](https://community.sendbird.com/t/default-channel-name-set-to-group-channel-when-there-are-2-users-only-how-to-change-that-to-show-the-persons-name-as-personal-chat/858/6 "2020-08-28T00:57:31Z")

</div>

Hello @Jay_Patel, I am Sravan, I work with react ui kit.  
Sorry for your confusion, this could be a bug in react side, we will look into this and get back to you.  
Can you tell us -

- Which version of UIKit you are using?
- What are your browser and O/S versions?
- Are you using `renderChannelPreview`?

In our implementation, when you create a channel with empty name, server sets it to “Group Channel”. So, in client side, for 1:1 channels, if the name of the channel is default one, we show the partner’s name. This is how all clients are supposed to handle it(looks like something might be off in our case).  
P.s. Can you ask these questions in UIKit section next time? We might miss your question if it is not in the correct section 😔

---

<div class="post-metadata">

**Author:** ![tahiralvi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tahiralvi/32/407_2.png) [@tahiralvi](https://community.sendbird.com/u/tahiralvi)\
**Post date:** [August 28, 2020, 5:46am UTC](https://community.sendbird.com/t/default-channel-name-set-to-group-channel-when-there-are-2-users-only-how-to-change-that-to-show-the-persons-name-as-personal-chat/858/7 "2020-08-28T05:46:36Z")

</div>

Hi @Sravan_S

Thanks for your quick answer for the @Jay_Patel question.  
Here are the details,

- UIKit Version (1.1.2)
- Chrome 85.0.4183.83 (Official Build) (64-bit), Firefox 80.0 on Windows 10 (64 Bit)
- Yes we are using the renderChannelPreview

---

<div class="post-metadata">

**Author:** ![Sravan\_S](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/sravan_s/32/83_2.png) [@Sravan\_S](https://community.sendbird.com/u/Sravan_S)\
**Post date:** [August 28, 2020, 6:39am UTC](https://community.sendbird.com/t/default-channel-name-set-to-group-channel-when-there-are-2-users-only-how-to-change-that-to-show-the-persons-name-as-personal-chat/858/8 "2020-08-28T06:39:44Z")

</div>

`Yes we are using the renderChannelPreview `  
Aha, in that case,  
If you followed this example [https://codesandbox.io/s/3-1-customizing-channelpreviewitem-ycsvs?file=/src/CustomizedChannelPreviewItem.js:1951-1990](https://codesandbox.io/s/3-1-customizing-channelpreviewitem-ycsvs?file=/src/CustomizedChannelPreviewItem.js:1951-1990)

It is recommended to use a logic similar to this -\>  
Other platforms also have implemented similar logic inside their UIKits

```auto
export const getChannelTitle = (channel = {}, currentUserId) => {
  // do not use channel.name if it is 'Group Channel'
  if (channel.name && channel.name !== "Group Channel") {
    return channel.name;
  }
  if (channel.members.length === 1) {
    return "NO_MEMBERS";
  }
  return channel.members
    .filter(({ userId }) => userId !== currentUserId)
    .map(({ nickname }) => (nickname || "(No Name)"))
    .join(", ");
};

```

* * *

## Or

Use **onBeforeCreateChannel** [https://github.com/sendbird/SendBird-JavaScript/tree/master/uikit-samples#channel-params](https://github.com/sendbird/SendBird-JavaScript/tree/master/uikit-samples#channel-params) to set channel name as that of your chat-partner on 1:1 channels  
(See the below example)  
[https://codesandbox.io/s/3-3-customizing-channellist-sg9kx?file=/src/CustomizedApp.js:473-530](https://codesandbox.io/s/3-3-customizing-channellist-sg9kx?file=/src/CustomizedApp.js:473-530)

Foot note - let me start a conversation with team on how to handle this default name scenario properly

---

<div class="post-metadata">

**Author:** ![tahiralvi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tahiralvi/32/407_2.png) [@tahiralvi](https://community.sendbird.com/u/tahiralvi)\
**Post date:** [August 28, 2020, 7:04am UTC](https://community.sendbird.com/t/default-channel-name-set-to-group-channel-when-there-are-2-users-only-how-to-change-that-to-show-the-persons-name-as-personal-chat/858/9 "2020-08-28T07:04:24Z")

</div>

@Sravan_S

Thanks for your quick answer and sample of code. Yes it will work for me.

I have another query related to the UIKit, can we show the input search on User Modal. So that a chat user can search from userslist?

Or if you are planning to release this feature in upcoming versions?

See the sample image.

 ![Custome_Sendbird_Search](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/1X/e6fe812fb968d04343e86b83c886ee3e1a43b2a5.png)

---

<div class="post-metadata">

**Author:** ![Sravan\_S](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/sravan_s/32/83_2.png) [@Sravan\_S](https://community.sendbird.com/u/Sravan_S)\
**Post date:** [August 28, 2020, 7:43am UTC](https://community.sendbird.com/t/default-channel-name-set-to-group-channel-when-there-are-2-users-only-how-to-change-that-to-show-the-persons-name-as-personal-chat/858/10 "2020-08-28T07:43:09Z")

</div>

So about search, yes, we are having discussion about including it these days. Agree, its really painful for going through the whole list to find other users.

The problem that we are facing is - there is no nickname/userId search support in server side. If we implement a search in client side, the results will not be meaningful, right? No official release dates have been set, sadly

Anyways, we were planning to open the create-channel component in upcoming releases. So that incase our default modal is not really ideal, you can create a custom list, at-least
