# how to get list of user in group in ui designer bonita 7.8.0?

**URL:** <https://community.ofelia.com/t/how-to-get-list-of-user-in-group-in-ui-designer-bonita-7-8-0/9607>\
**Category:** Q&A\
**Created:** [4 May 2019 15:31 UTC](https://community.ofelia.com/t/how-to-get-list-of-user-in-group-in-ui-designer-bonita-7-8-0/9607 "2019-05-04T15:31:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![haddedr2\_1391532](https://avatars.discourse-cdn.com/v4/letter/h/0ea827/32.png) [@haddedr2\_1391532](https://community.ofelia.com/u/haddedr2_1391532)\
**Post date:** [4 May 2019 15:31 UTC](https://community.ofelia.com/t/how-to-get-list-of-user-in-group-in-ui-designer-bonita-7-8-0/9607/1 "2019-05-04T15:31:06Z")

</div>

i wont to get list of users in specific group and display in a select Widget in ui designer.  
What type of API I want to use it?

---

<div class="post-metadata">

**Author:** ![nasrin788\_1384620](https://avatars.discourse-cdn.com/v4/letter/n/2acd7d/32.png) [@nasrin788\_1384620](https://community.ofelia.com/u/nasrin788_1384620)\
**Post date:** [5 May 2019 09:58 UTC](https://community.ofelia.com/t/how-to-get-list-of-user-in-group-in-ui-designer-bonita-7-8-0/9607/2 "2019-05-05T09:58:19Z")

</div>

Hi

The following example can help you.  
You should define a local variable and set list of student to it, then using external API in form designer, getting the variable and set it to select widget.

`import org.bonitasoft.engine.search.SearchOptionsBuilder  
import org.bonitasoft.engine.identity.User  
import org.bonitasoft.engine.profile.ProfileSearchDescriptor  
import org.bonitasoft.engine.identity.GroupSearchDescriptor  
import org.bonitasoft.engine.identity.UserSearchDescriptor

SearchOptionsBuilder s = new SearchOptionsBuilder(0, 1)  
s.filter(GroupSearchDescriptor.NAME, “students”)  
Long groupId = apiAccessor.getIdentityAPI().searchGroups(s.done()).getResult().get(0).getId()

SearchOptionsBuilder s1 = new SearchOptionsBuilder(0, -1)  
s1.filter(UserSearchDescriptor.GROUP\_ID, groupId)

List studentList = new ArrayList()

for (User user: apiAccessor.getIdentityAPI().searchUsers(s1.done()).getResult()) {  
Person t = new Person(user.getId(), user.getFirstName(), user.getLastName());  
studentList.add(t)  
}

studentList  
`

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/community_bonitasoft/original/2X/6/6b7b18c0478f2645369e82e009b65e3b97f2cc12.svg) [@system](https://community.ofelia.com/u/system)\
**Post date:** [7 May 2019 07:22 UTC](https://community.ofelia.com/t/how-to-get-list-of-user-in-group-in-ui-designer-bonita-7-8-0/9607/3 "2019-05-07T07:22:42Z")

</div>

Your solution is valid but you are duplicating information store in Bonita Engine database in a process variable that will itself been stored in the Bonita Engine database.

Instead I would recommend to declare a form variable initialized with a REST API call to the [REST identity API](https://documentation.bonitasoft.com/bonita/7.8/identity-api). Then the REST API call result stored in the form variable can be mapped to the selected widget. This will prevent any duplication of the data in the database (it will be only temporary duplicated in the web browser memory).
