I have a set of Sharepoint groups to be created with RestApi. But before creating i have to check if the group doenst exist already and then create. Is there a way to send multiple group names and find out if they are already present?
1 Answer
You could call /Web/SiteGroups
with multiple $filter
values, e.g.,
_api/Web/SiteGroups?$filter=Title eq 'GroupA' or Title eq 'GroupB'
Afterwards you would have to cross-reference results with your own names, e.g., with underscore:
_.difference(yourGroupNames, _.pluck(groups, 'Title'))