# How to create multiple rooms using CreateBO

**URL:** <https://devforum.zoom.us/t/how-to-create-multiple-rooms-using-createbo/67590>\
**Category:** Windows\
**Created:** [April 15, 2022, 2:24pm UTC](https://devforum.zoom.us/t/how-to-create-multiple-rooms-using-createbo/67590 "2022-04-15T14:24:28Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![hanataba](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/hanataba/32/34209_2.png) [@hanataba](https://devforum.zoom.us/u/hanataba)\
**Post date:** [April 15, 2022, 2:24pm UTC](https://devforum.zoom.us/t/how-to-create-multiple-rooms-using-createbo/67590/1 "2022-04-15T14:24:28Z")

</div>

**Description**

The following program works. but, it sometimes fails.  
When run CreateBO in “room2”, BO\_ID become null.

```auto

    struct BOSetting
    {
        std::wstring name;
        std::vector<std::wstring> userids;
    };

    //rooms is BOSetting array. name and userids is setted before this code.
    //rooms value like this
    // [
    // {"room1", ["user1useridstr","user1useridstr"]},
    // {"room2", ["user3useridstr","user4useridstr"]},
    // ]

    for (int i = 0; i < rooms.size(); i++) {

        auto room = rooms[i];

        const wchar_t* BO_ID = MyMeetingBOControllerEvent::GetInstance().mypCreatorObj->CreateBO(room.name.c_str());

        for (int j = 0; j < room.userids.size(); j++)
        {
            if (MyMeetingBOControllerEvent::GetInstance().mypCreatorObj->AssignUserToBO(room.userids[j].c_str(), BO_ID)) {
                print("AssignUserToBO success");
            }
            else
            {
                print("AssignUserToBO error");
            }
        }
    }

```

Should I do the following? But onBOCreateSuccess is slow.

> Create BO → Wait for onBOCreateSuccess → Create the next BO

Maybe IBatchCreateBOHelper can solve it? Can you create it all at once?

**Which Windows Meeting SDK version?**  
v5.9.3.3191

**Device (please complete the following information):**

- Device:  
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz 2.10 GH  
16.0 GB RAM  
1T SSD
- OS: Windows 10 Pro 64bit

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [April 15, 2022, 8:01pm UTC](https://devforum.zoom.us/t/how-to-create-multiple-rooms-using-createbo/67590/2 "2022-04-15T20:01:58Z")

</div>

Hi @hanataba,

You are definitely on the right track asking about the `IBatchCreateBOHelper`. This class allows you to add multiple rooms to the helper, and then create them all via `CreateBoTransactionCommit`. Be sure to call `CreateBOTransactionBegin` before you start adding breakout room names.

Thanks!

---

<div class="post-metadata">

**Author:** ![hanataba](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/hanataba/32/34209_2.png) [@hanataba](https://devforum.zoom.us/u/hanataba)\
**Post date:** [April 16, 2022, 11:35am UTC](https://devforum.zoom.us/t/how-to-create-multiple-rooms-using-createbo/67590/3 "2022-04-16T11:35:04Z")

</div>

@jon.lieblich

Thank you. I changed the program as below

```auto

    MyMeetingBOControllerEvent::GetInstance().mypCreatorObj->GetBatchCreateBOHelper()->CreateBOTransactionBegin();

    for (int i = 0; i < rooms.size(); i++) {

        auto room = rooms[i];

        const wchar_t* BO_ID = MyMeetingBOControllerEvent::GetInstance().mypCreatorObj->CreateBO(room.name.c_str());

        for (int j = 0; j < room.userids.size(); j++)
        {
            if (MyMeetingBOControllerEvent::GetInstance().mypCreatorObj->AssignUserToBO(room.userids[j].c_str(), BO_ID)) {
                print("AssignUserToBO success");
            }
            else
            {
                print("AssignUserToBO error");
            }
        }
    }

    MyMeetingBOControllerEvent::GetInstance().mypCreatorObj->GetBatchCreateBOHelper()->CreateBoTransactionCommit();

```

but I have the same problem.

i think , i have to CreateBoTransactionCommit() run every time CreateBO().  
and i changed the program as below.

```auto

    MyMeetingBOControllerEvent::GetInstance().mypCreatorObj->GetBatchCreateBOHelper()->CreateBOTransactionBegin();

    for (int i = 0; i < rooms.size(); i++) {

        auto room = rooms[i];

        const wchar_t* BO_ID = MyMeetingBOControllerEvent::GetInstance().mypCreatorObj->CreateBO(room.name.c_str());

        for (int j = 0; j < room.userids.size(); j++)
        {
            if (MyMeetingBOControllerEvent::GetInstance().mypCreatorObj->AssignUserToBO(room.userids[j].c_str(), BO_ID)) {
                print("AssignUserToBO success");
            }
            else
            {
                print("AssignUserToBO error");
            }
        }

        MyMeetingBOControllerEvent::GetInstance().mypCreatorObj->GetBatchCreateBOHelper()->CreateBoTransactionCommit();

    }

```

but I have the same problem.

i think , i have to CreateBOTransactionBegin() and CreateBoTransactionCommit() run every time CreateBO().  
and i changed the program as below.

```auto

    for (int i = 0; i < rooms.size(); i++) {

        auto room = rooms[i];

        MyMeetingBOControllerEvent::GetInstance().mypCreatorObj->GetBatchCreateBOHelper()->CreateBOTransactionBegin();

        const wchar_t* BO_ID = MyMeetingBOControllerEvent::GetInstance().mypCreatorObj->CreateBO(room.name.c_str());

        for (int j = 0; j < room.userids.size(); j++)
        {
            if (MyMeetingBOControllerEvent::GetInstance().mypCreatorObj->AssignUserToBO(room.userids[j].c_str(), BO_ID)) {
                print("AssignUserToBO success");
            }
            else
            {
                print("AssignUserToBO error");
            }
        }

        MyMeetingBOControllerEvent::GetInstance().mypCreatorObj->GetBatchCreateBOHelper()->CreateBoTransactionCommit();

    }

```

but I have the same problem.

what should i do?

---

<div class="post-metadata">

**Author:** ![hanataba](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/hanataba/32/34209_2.png) [@hanataba](https://devforum.zoom.us/u/hanataba)\
**Post date:** [April 18, 2022, 12:43pm UTC](https://devforum.zoom.us/t/how-to-create-multiple-rooms-using-createbo/67590/4 "2022-04-18T12:43:41Z")

</div>

@jon.zoom

Can you give me some information?

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [April 19, 2022, 8:51pm UTC](https://devforum.zoom.us/t/how-to-create-multiple-rooms-using-createbo/67590/5 "2022-04-19T20:51:18Z")

</div>

Hi @hanataba,

It does not look like `IBatchCreateBOHelper` is being used correctly. After create the transaction, you should use the `AddNewBoToList` for each breakout room you would like to create. After these have all been added to the helper through that method, you commit the transaction. `CreateBO` is only meant to be used for creating rooms individually.

Thanks!

---

<div class="post-metadata">

**Author:** ![precisao](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/precisao/32/31723_2.png) [@precisao](https://devforum.zoom.us/u/precisao)\
**Post date:** [April 20, 2022, 2:00pm UTC](https://devforum.zoom.us/t/how-to-create-multiple-rooms-using-createbo/67590/6 "2022-04-20T14:00:09Z")

</div>

And, additionally, I suppose you can only AssignUserToBO after the creation is committed.

---

<div class="post-metadata">

**Author:** ![hanataba](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/hanataba/32/34209_2.png) [@hanataba](https://devforum.zoom.us/u/hanataba)\
**Post date:** [April 21, 2022, 5:02am UTC](https://devforum.zoom.us/t/how-to-create-multiple-rooms-using-createbo/67590/7 "2022-04-21T05:02:30Z")

</div>

@jon.zoom @precisao  
Thank you for your reply.

When can I get the BOID?

Is onBOCreateSuccess called when committed?

If called,  
Will it be called once?  
Or is it called as many as the number of BOs made?

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [April 21, 2022, 9:08pm UTC](https://devforum.zoom.us/t/how-to-create-multiple-rooms-using-createbo/67590/8 "2022-04-21T21:08:56Z")

</div>

Hi @hanataba,

You provide the ID when you call `AddNewBoToList`, and it will also be provided in the `onBOCreateSuccess` callback, which is triggered each time a breakout room is successfully created.

Thanks!

---

<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:** [May 22, 2022, 7:09am UTC](https://devforum.zoom.us/t/how-to-create-multiple-rooms-using-createbo/67590/9 "2022-05-22T07:09:26Z")

</div>

Closed on May 22, 2022, 7:09am UTC

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