# Getting the order of entry for Participant

**URL:** <https://devforum.zoom.us/t/getting-the-order-of-entry-for-participant/113813>\
**Category:** Web\
**Tags:** video-sdk\
**Created:** [July 17, 2024, 4:48am UTC](https://devforum.zoom.us/t/getting-the-order-of-entry-for-participant/113813 "2024-07-17T04:48:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![H-Takesue](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/h-takesue/32/60015_2.png) [@H-Takesue](https://devforum.zoom.us/u/H-Takesue)\
**Post date:** [July 17, 2024, 4:48am UTC](https://devforum.zoom.us/t/getting-the-order-of-entry-for-participant/113813/1 "2024-07-17T04:48:09Z")

</div>

**Video SDK Web and Version**  
Zoom Web Video SDK 1.11.6  
Google Chrome

Hello.

I am currently using the Video SDK in a web browser.

One of the requirements we are currently trying to achieve is to realize an exclusivity control where if there are multiple joins to a session with the same account (userIdentifer is given via server), the participant who was originally there will leave the session.

Currently, we assume that the last participant obtained by getAllUser() is the newest participant.  
Is there any other way to get a guaranteed join order?

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [July 18, 2024, 6:16am UTC](https://devforum.zoom.us/t/getting-the-order-of-entry-for-participant/113813/2 "2024-07-18T06:16:11Z")

</div>

Hey @H-Takesue

Thanks for your feedback.

In the Video SDK, we provide the `user-added` event, which is triggered when a new user joins the session. The event payload contains the new user’s information, allowing you to determine if it is a duplicate user.

```javascript
client.on("user-added", (payload) => {
  const allUsers = client.getAllUser();
  payload.forEach((user) => {
    const { userIdentity, userId } = user;
    if (userIdentity) {
      const duplicatedUsers = allUsers.filter(
        (item) => item.userIdentity === userIdentity
      );
      // If there are more than one users, it indicates the presence of duplicate users.
      if (duplicatedUsers.length > 1) {
        const originalUser = duplicatedUsers.filter(
          (item) => item.userId !== userId
        );
        // Todo: let the original user leave the session
      }
    }
  });
});

```

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [August 17, 2024, 4:17pm UTC](https://devforum.zoom.us/t/getting-the-order-of-entry-for-participant/113813/3 "2024-08-17T16:17:09Z")

</div>

Closed on August 17, 2024, 4:17pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
