useGroupUsers

useGroupUsers(
	groupId: `string` | `number`,
	options?: GroupUsersOptions,
	deps?: any[]): ISiteUserInfo[] | null | undefined;

Returns user collection from specific group.

Examples

Get group users,

const myGroupUsers = useGroupUsers(10);

const myGroupUsers = useGroupUsers("My SharePoint Group");

Query group users,

const filteredGroupUsers = useGroupUsers("My SharePoint Group", {
	query:{
		select: ["LoginName", "Title"],
		filter: "IsSiteAdmin eq false"
	}
});

Parameters

NameTypeDescriptionTracked for changes
groupIdstring | numberGroup Id or nameYes
options?GroupUsersOptionsuseGroupUsers hook optionsPartially
deps?DependencyListHook dependency list.Yes